[Vuejs]-Updating Nested Objects in Vue using VeeValidate Form issue

0👍

From what I can see, you are expecting vee-validate to update the formValues prop which isn’t a correct assumption, since:

  • It is not two-way binding like with v-model
  • vee-validate does not emit changes from the form component.

You should instead use useForm since you want access to your form values and remove the Form component. I see it is already imported for some reason.

const { values, resetForm } = useForm();


// Wait for the data to load, or you can use `until` from `@vueuse/core` with the mounted lifecycle hook.
watch([authIsLoading, companyIsLoading], ([auth, company]) => {
  if (auth || company) {
    return;
  }

  // sets initial and current values.
  resetForm({ values: { ...authData.value, ...companyData.value } });
});

Leave a comment