子组件:
data: {
show: true,
},
checkFun() {
this.show = false
}
父组件:
父组件使用子组件:
<child id="child"></child>
// 获取子组件中的data值
const child= this.selectComponent('#child');
console.log(child.data.show);
// 调用子组件的方法
useChildFun() {
this.selectComponent('#child').checkFun();
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。