1、table上增加 @row-click="handleClickTableRow"
2、單選框的checkbox那列加上 @selection-change="handleSelectionChange"
3、table加上ref
程式碼實現:
methods: {
handleClickTableRow(row, event, column) {
console.log(row);
console.log(column);
this.$refs.fileTable.toggleRowSelection(row);
},
handleSelectionChange(rows) {
console.log(rows);
this.multipleSelection = rows;
},
},