[Vuejs]-Vue: watching a v-model's 'value' in a component

0👍

From what I understand you are trying to pass a prop to your child component from your parent one and watch it in your child.

Assuming you have something like this in your parent:

<div>
   <my-component v-model="someData.someProp"></my-component>
</div>

I understand you are getting undefined for that prop when you watch it, which is normal because you should pass it like this:

<my-component :myValue="someData.someProp"></my-component>

Then you should have access to the prop trought this.myValue.
If someData.someProp changes on the parent component it will automatically reflect on the child one.

Again this is what I could understand from your explanation and the amount of code you provided.

Leave a comment