遇到问题请查看 博客
// 基础布局 核心参数 ref highlight-current-row
<el-table ref="monthlyPlanTable" highlight-current-row :data="tableData">
<el-table-column prop="name" label="测试" align="center"></el-table-column>
/el-table>
// 方法 核心参数setCurrentRow this.$nextTick this.tableData是表格绑定的数据 this.tableData[0]代表第一行
this.$nextTick(() => {
if( this.tableData.length > 0){
this.$refs.monthlyPlanTable.setCurrentRow(this.tableData[0])
}
});