Vuejs Watch Nested Property

Posted on  by admin

Hi,I’m trying to understand how to properly watch for some prop variation.I have a parent component (.vue files) that receive data from an ajax call, put the data inside an object and use it to render some child component through a v-for directive, below a simplification of my implementation:.

… then inside “script” tag:. item object are like this:. Now, inside my child “player” component I’m trying to watch for any Item’s property variation and I use:.

It works but it seems a bit tricky to me and I was wondering if this is the right way to do it.

My goal is to perform some action every time “prop” changes or myArray gets new elements or some variation inside existing onesAny suggestion will be appriciated.

Modified6 months ago. I'm trying to understand how to properly watch for some prop variation.I have a parent component (.vue files) that receive data from an ajax call, put the data inside an object and use it to render some child component through a v-for directive, below a simplification of my implementation:.

then inside