Setting up the initial values of a form using props #3377
Unanswered
MaelAbgrall
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Quite new using VueJS, I'm trying to make my form into a component (so the form can be used both to edit existing content or to create new content).
I started to create the form in a view, and put initial values as explained in the documentation.
However when I started to refactor the view to make the form into a component, the :initialvalues="formValues" do not work anymore: I'm passing an object as a prop with the field values (the "create" view would send an object with empty variables, and the "edit" view should send an object with the original data). I checked and the props are send properly to the component, however the fields are empty
here is a minimal reproduction: view.vue
and the CategoryEditor.vue
Update:
While trying to work on something else, I found that this issue was happening only when:
If I'm navigating to this page from somewhere else, the inputs are pre-populated with the data
Beta Was this translation helpful? Give feedback.
All reactions