Element设置某一行选中

遇到问题请查看 博客

// 基础布局 核心参数 ref highlight-current-row
<el-table ref="monthlyPlanTable" highlight-current-row>
	<el-table-column prop="name" label="测试" align="center"></el-table-column>
/el-table>
// 方法 核心参数setCurrentRow this.$nextTick
this.$nextTick(() => {
    
    
		if( this.tableData.length > 0){
    
    
			this.$refs.monthlyPlanTable.setCurrentRow(this.tableData[0])
		}
	});

猜你喜欢

转载自blog.csdn.net/weixin_44640323/article/details/108518413