
说明:
1、type="selection"选中事件
2、@cell-mouse-enter鼠标移到列表触发事件
问题:执行@cell-mouse-enter的时候会直接取消type="selection"选中事件。
解决方法:
cellMouseEnter(row, column, cell, event) {
let Arr = JSON.parse(JSON.stringify(this.listData));
for (let index = 0; index < Arr.length; index++) {
const element = Arr[index];
// 匹配滑过的当前行
if (element.id === row.id) {
element["hoverFlag1"] = true;
} else {
element["hoverFlag1"] = false;
}
}
this.listData = JSON.parse(JSON.stringify(Arr));
let rows = [];
//获取选中数据dataonLineListSelections
if (this.dataonLineListSelections.length > 0) {
for (let i = 0; i < this.listData.length; i++) {
if (this.listData[i].id == this.dataonLineListSelections[0].id) {
rows.push(this.listData[i]);
this.$nextTick(() => {
rows.forEach(row => {
//重新定义type="selection"
this.$refs.table.toggleRowSelection(row);
});
});
}
}
}
}
el-table利用:row-style="rowClass"设置指定行变色
el-table表格显示selection多选时对某些复选框设置禁止选中
el-table表格实现多选功能(全选/指定选中/取消选中)
上面是“el-table解决@cell-mouse-enter和type="selection"同时存在bug”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2172.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

帝国cms技巧之如何实现远程发布