父組件主動獲取子組件的數據和方法
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刪除。