父組件如何獲取子組件的ref呢
父組件
<div>
<child></child>
</div>
子組件child
<div>
<el-table ref="person"></el-table>
</div>
如何獲取子組件的table的clearSort() 方法呢牙丽?
方案:給父組件添加ref勇哗,一級一級往下找,找到子組件的ref帝簇,定位到為table,調(diào)用clearSort()
<div>
<child ref="people"></child>
</div>
this.$refs.people.refs.person.$children[0].clearSort()用于清空table的排序功能的藍(lán)色箭頭高亮