父组件主动获取子组件的数据和方法
1.调用子组件的时候 定义一个ref
<headerchild ref="headerChild"></headerchild>
2.在父组件里面通过
this.$refs.headerChild.属性 t
his.$refs.headerChild.方法
子组件主动获取父组件的数据和方法
this.$parent.属性
this.$parent.方法
1.调用子组件的时候 定义一个ref
<headerchild ref="headerChild"></headerchild>
2.在父组件里面通过
this.$refs.headerChild.属性 t
his.$refs.headerChild.方法
this.$parent.属性
this.$parent.方法
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。