[Vuejs]-Vue.js: How the child components mutate the parent's state?

2👍

The two-way binding works as you might think it does: when you change a property in the parent, it gets changed in the children, and vice versa. Take a look at this as an example: https://jsfiddle.net/u0mmcyhk/1/, the children is able to change the state of the parent. If you remove .sync from the parent template, it stops working.

Having said that, .sync will be deprecated on 2.0, in favour of communication (broadcast, dispatch) or some state management like vuex.

More information: https://vuejs.org/api/#v-bind

Leave a comment