场景:vue父页面传值,参数为plant,
问题:父页面改变plant的值,子页面没有实时更新
解决方法:
1.父页面参数加一个 .sync
<
hqlist
:plant.sync="
plante"
></
hqlist
>
2.子页面watch 参数的变化,并执行function
watch:{
plant(
value,
oldvalue){
this.
plant =
value;
this.
getCompanyList();
}
}