<el-table
@row-click="clickRow"
:data="tableData"
border
ref="yourTable"
max-height="300"
style="width: 100%;margin-top: 20px;"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="index" fixed label="序1号" width="80"></el-table-column>
<el-table-column prop="mateName" fixed label="名称" width="150"></el-table-column>
<el-table-column prop="remarks" label="说明" width="180"></el-table-column>
</el-table>
methods: {
clickRow(row) {
this.$refs.yourTable.toggleRowSelection(row);
},
}