最终效果
*================================ 代码 ===============================*
<el-table
ref="multipleTable_select"
:data="selectMemberDataList"
:stripe="true"
class="el-ov-single-checkbox-table"
@select="handleSelect_select"
>
<el-table-column
type="selection"
width="55"
/>
<el-table-column
label="序号"
type="index"
width="60"
>
</el-table-column>
<el-table-column
label="策略名称"
prop="name"
width="220"
/>
</el-table>
handleSelect_select(selection, row) {
//清空所有选中
this.$refs.multipleTable_select.clearSelection();
//选中当前checkbox
this.$refs.multipleTable_select.toggleRowSelection(row, true);
//保存当前选中的对象
this.multipleSelection_selectMember = row;
},
/*
scss语法,不懂请百度
隐藏全选Checkbox
*/
.el-ov-single-checkbox-table {
thead {
th:first-child {
span:first-child {
display: none;
}
}
}
}
如果帮到你了,请点个赞吧~