组件调用时使用修饰符.sync:
<hello-world :msg.sync="msg"></hello-world>
子组件内部更新事件如下:
updateMsg() {
this.$emit('update:msg', 'Hei you');
}
组件调用时使用修饰符.sync:
<hello-world :msg.sync="msg"></hello-world>
子组件内部更新事件如下:
updateMsg() {
this.$emit('update:msg', 'Hei you');
}