比如这个Test组件:
<template>
<div>
<el-table ref="table" v-bind="$attrs"/>
</div>
</template>
现在另一个组件Faker.vue引用了Test组件, 现在想调用Test中的el-table的方法需要这么调用
this.$refs.test.$refs.table.setCurrentRow()
如何做到
this.$refs.test.setCurrentRow()
这样调用?
当然了在我并不想在Test中硬写el-table中的方法做过渡。
Test.vue
父组件
参考代码
https://codesandbox.io/s/craz...