步骤:1.给父组件定义一个ref
2.子组件也是一样的ref
父组件
<div>
<subpage ref="table"></subpage>
</div>
子组件
<div ref="subTable">
</div>
//在控制台 可以看到很多属性,本质就是一个字符串
console.log(this.$refs.table)
//这样就获取到了
console.log(this.$refs.table.$refs.table)
步骤:1.给父组件定义一个ref
2.子组件也是一样的ref
父组件
<div>
<subpage ref="table"></subpage>
</div>
子组件
<div ref="subTable">
</div>
//在控制台 可以看到很多属性,本质就是一个字符串
console.log(this.$refs.table)
//这样就获取到了
console.log(this.$refs.table.$refs.table)