在父组件中改变子组件里的数据
<!--在父组件中引用子组件,添加ref标识-->
<son ref="son"></son>
//父组件点击事件
clickFunc(){
//若更新子组件里a的值
this.$refs.son.a = 'xx';
//若调用子组件里b方法
this.$refs.son.b();
}
<!--在父组件中引用子组件,添加ref标识-->
<son ref="son"></son>
//父组件点击事件
clickFunc(){
//若更新子组件里a的值
this.$refs.son.a = 'xx';
//若调用子组件里b方法
this.$refs.son.b();
}