element-ui——table默认选中第几行

<el-table :data="transformTableData" ref="transformTableData" >
    <el-table-column prop="name" label="名字"></el-table-column>
</el-table>
<button @click="myClick">
    选中第一行
</button>
// 选中第一行
myClick () {
this.$refs.transformTableData.setCurrentRow(this.transformTableData[1])
}

猜你喜欢

转载自blog.csdn.net/qq_43201350/article/details/120303793