父組件主動獲取子組件的數據和方法
1.調用子組件的時候 定義一個ref
<headerchild ref="headerChild"></headerchild>
2.在父組件裏面通過
this.$refs.headerChild.屬性 t
his.$refs.headerChild.方法
子組件主動獲取父組件的數據和方法
this.$parent.屬性
this.$parent.方法
轉載於:https://www.cnblogs.com/cengjingdeshuige/p/11059656.html