
1、template代码 <el-table ref="table" :data="tableData" @selection-change="handleSelectionChange"> <el-table-column type="selection" /> <!-- 其他列... --> </el-table> 2、script代码 data(){ tableData:[] dataonLineListSelections:[] }, methods:{ // 表格勾选 handleSelectionChange(val) { // 单选 if (val.length > 1) { this.$refs.table.clearSelection() this.$refs.table.toggleRowSelection(val.pop()) } this.dataonLineListSelections = val } }
el-table利用:row-style="rowClass"设置指定行变色
el-table表格显示selection多选时对某些复选框设置禁止选中
el-table表格实现多选功能(全选/指定选中/取消选中)
上面是“el-table多选框(type="selection")改为单选框的”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_28.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

vue开发中的最常用的7大属性介绍
seo文章应该怎么写?现场指导
ComfyUI API Liberation安装使用入口,内置API节点的核心增强插件
Bootstrap4轮播图添加手势滑动代码(移动端)
AI World Generator:一款专业的实时交互式3D世界生成平台