说明:
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解决@cell-mouse-enter和type="selection"同时存在bug”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。
编程基础网
本文标题为:el-table解决@cell-mouse-enter和type="selection"同时存在bug
基础教程推荐
猜你喜欢
- css如何修改input输入框placeholder样式 2024-12-14
- js获取指定的cookie的具体实现 2024-01-12
- uni-app实现视频组件播放和暂停 2023-08-29
- jQuery 选择符详细介绍及整理 2024-01-16
- BootStrap glyphicons 字体图标实现方法 2023-12-20
- vue中动态引进组件、动态引进js模块文件 2023-10-08
- document.cookie 使用小结 2024-01-12
- 手把手教你实现vue下拉菜单组件 2023-10-08
- 使用FormData进行Ajax请求上传文件的实例代码 2023-02-22
- Three.Js实现看房自由小项目 2023-12-14
