As v2 guide claims, this is the preferred way of doing communication between parent-child:
Let's say we have this structure:
<task-list>
<task v-for="task in list" v-bind:task="task"></task>
</task-list>
Task component gets the task object by props, but how should it inform the parent about the intended changes to the prop? In Angular world, it was ok for the child to directly manipulate the data passed to it, so I'm not sure how the Vue way should look like.
Any tips or sample codes would be highly appreciated! :)
Thanks for the example. In this case, it makes perfect sense and the execution is clean.
But what if 'button-counter' component wanted to change the object passed to it by the parent? According to the guidelines, the child shouldn't directly manipulate the passed object. Should it be something like that, even if it feels a little wrong?