You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue where I am attempting to populate the fields from an API. However, the data is not going through to the $form data object.
There is this bug here: #6755 - Not sure if it'll solve my issue, however, if it does, I'll wait till it's released.
So, essentially, in the onMounted, it is getting the data from the API and populating to the initialValues, however when this is done, it does not appear to be passing to the input fields.
If I add a v-model="initialValues.first_name", this kinda works. Where the data populates, but if you hit the submit button, it throws field errors saying it's required, because the value in the $form.first_name.value has not been populated.
Am I doing it incorrectly or is this an issue that might be resolved from this bug?
Here is my code (stripped out the non important parts):
I have the same issue using the zod resolver. When the form is used to create, it works. But forms are not used only for the initial creation of a record. Forms are also used for mutating existing records. I agree with magicMustard the standard vuejs v-model functionality should be kept. I guess I will keep using Vuelidate for now.
Describe the bug
I have an issue where I am attempting to populate the fields from an API. However, the data is not going through to the $form data object.
There is this bug here: #6755 - Not sure if it'll solve my issue, however, if it does, I'll wait till it's released.
So, essentially, in the onMounted, it is getting the data from the API and populating to the initialValues, however when this is done, it does not appear to be passing to the input fields.
If I add a v-model="initialValues.first_name", this kinda works. Where the data populates, but if you hit the submit button, it throws field errors saying it's required, because the value in the $form.first_name.value has not been populated.
Am I doing it incorrectly or is this an issue that might be resolved from this bug?
Here is my code (stripped out the non important parts):
Reproducer
https://stackblitz.com/edit/wafqr9?file=src%2FApp.vue
PrimeVue version
4.2.2
Vue version
4.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Firefox 132.0.1 - Fedora
Steps to reproduce the behavior
Expected behavior
It should populate the input fields with the data as you'd expect if you were to use v-model.
The text was updated successfully, but these errors were encountered: