fix:处理因为改变addEventLister方法造成的报错问题

This commit is contained in:
zhangyu
2020-11-20 18:03:57 +08:00
parent 74d8f02a73
commit 4f2d0b3e54
6 changed files with 21 additions and 12 deletions

View File

@@ -503,9 +503,11 @@
}
},
beforeDestroy(){
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLaeve);
document.querySelector("body>.el-dropdown-menu").removeEventListener("ps-y-reach-end", this.psYReachEnd);
if(document.querySelector("#tableList")){
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLaeve);
document.querySelector("body>.el-dropdown-menu").removeEventListener("ps-y-reach-end", this.psYReachEnd);
}
}
}
</script>