element table组件多选改单选
效果图
- table组件属性设置
- 选中事件处理
handleSelectionChange (val) {
this.multipleSelection = val;
if (val.length) {
if (val.length > 1) {
this.$refs.multipleTable.toggleRowSelection(val[0]);
}
this.ruleForm.userName = this.multipleSelection[0].username
}
}
- 隐藏全选勾选框
// 隐藏全选框
::v-deep .has-gutter .el-table-column--selection .el-checkbox {
display: none !important;
}
共有 0 条评论