父页面的dom,调用子控件时需要安个ref 勾子
<screenBox ref="screenChild"></screenBox>
子控件的methods 里面加上方法
methods: {
resetIcon(){
//do something
this.index_ = 0;
}
}
最后调用:
this.$refs['screenChild'].resetIcon();
场景:
例:父页面加载完数据,要求把子控制的筛选图标初始化。