原先用的是@selection-change="selectionLineChangeHandle",发现会出现数据错乱,选中下一条获取的数据还是上一条。解决方法如下:
template代码
//把下面语句 el-table @selection-change="selectionLineChangeHandle" ref="table" //改成 el-table @select="(selection, row) => {selectionLineChangeHandle(selection, row);}" ref="table"
js代码
//选中事件 selectionLineChangeHandle(selection, val) { // 单选 this.dataonLineListSelections = []; if (selection.length > 1) { this.$refs.table.clearSelection(); this.$refs.table.toggleRowSelection(selection.pop()); } if (selection.length > 0) { this.dataonLineListSelections.push(val); } }
在列表接口中清空dataonLineListSelections
el-table利用:row-style="rowClass"设置指定行变色
el-table表格显示selection多选时对某些复选框设置禁止选中
el-table表格实现多选功能(全选/指定选中/取消选中)
上面是“el-table 单项type="selection"出现数据错乱解决”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_1979.html
workflows工作流
图生图工作流:藏族姑娘ComfyUI工作流
树上挂着一只表情可爱的香蕉ComfyUI工作流二
一个闪闪发光的金属球ComfyUI工作流
池塘边的大熊猫ComfyUI工作流
一张超现实主义美女照片ComfyUI工作流
一棵白色心形流苏树comfyui工作流
一个精致透明的朱红色水晶凤凰
一只千纸鹤坐在路上哭泣ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!