在 < el-table> 中添加 ref="leftTable"作为该表的标识
<el-table
ref="leftTable"
v-loading="listLoading"
:data="tableData1"
:show-header="false"
style="width: 100%;color: #303133;"
border fit highlight-current-row
>
添加watch监听事件
export default {
//监听,tableData1为表格数据,
watch: {
tableData1: function() {
this.$nextTick(function() {
this.$refs.leftTable.setCurrentRow(this.tableData1[0])
})
}
},
}