fix:解决控制台报错的问题

This commit is contained in:
zhangyu
2020-12-21 10:06:48 +08:00
parent 082ac93634
commit 23a40f8e0c
2 changed files with 15 additions and 11 deletions

View File

@@ -702,15 +702,17 @@
setTimeout(()=>{ setTimeout(()=>{
this_.setData(); this_.setData();
setTimeout(()=>{ setTimeout(()=>{
this_.zoom=this_.network.view.targetScale; if(this_.network){
this_.network.moveTo({ this_.zoom=this_.network.view.targetScale;
// position: this_.viewsCenter, this_.network.moveTo({
scale: this_.zoom-0.1, // position: this_.viewsCenter,
offset: {x:0, y:0}, scale: this_.zoom-0.1,
}); offset: {x:0, y:0},
this_.modelTopUpdate(); });
this_.selNodeArrUpdate(); this_.modelTopUpdate();
this_.networkPopShow=false; this_.selNodeArrUpdate();
this_.networkPopShow=false;
}
},100) },100)
}); });
return false return false

View File

@@ -732,8 +732,10 @@
}, },
}, },
beforeDestroy(){ beforeDestroy(){
document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter); if(document.querySelector("#tableList")){
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave); document.querySelector("#tableList").removeEventListener("mouseenter", this.tableListEnter);
document.querySelector("#tableList").removeEventListener("mouseleave", this.tableListLeave);
}
this.scrollbarWrap.removeEventListener('scroll', bus.debounce); this.scrollbarWrap.removeEventListener('scroll', bus.debounce);
} }
} }