Replies: 1 comment 4 replies
-
@itsfaqih Try to initialize the form with it's default/initial data. Vue 3 Example: const form = useForm({
name: 'John Doe',
email: '[email protected]',
}) When you set the values after initialization of the form, you will trigger the isDirty watcher. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be useful for a form inside a modal that used for both create and edit form.
Here's what I mean:
As you can see from the disabled submit button, the
isDirty
property works as expected because the current value of the form is the exact same as its initial value.But it'd be a problem when we use this form for the edit:
The submit button become enabled even though I haven't change anything, this is because the values aren't the same as its initial value which is an empty string.
So, I hope there's a way to change the form's initial value
Beta Was this translation helpful? Give feedback.
All reactions