Object in v-model
-
I tried to define an object in v-model in a parent component & then use it in child component(CarSearch.vue) but whenever I made changes & press the button , I get null for the changed object in the console .
I would like to know how I should modify my code to see the changed value in the console.
Here is my code in codesandbox . -
That’s because in Vue changes in props made by the child component don’t go down to the parent where they came from. You’ll have to use events to send changes from the child to the parent to update.
-
@dobbel actually it’s possible to use change, I solved it you can check it out:
https://codesandbox.io/s/awesome-hooks-my4fk?file=/src/components/CarSearch.vue