jigsaw
jigsaw copied to clipboard
graph订阅mouseover,mouseout事件容易产生性能问题
graph内部的事件监听会导致angular产生变更检查。
通过在注册事件上添加this._zone.runOutsideAngular,还是会触发变更检查
// 注册封装的echarts事件.
private _registerEvent() {
this._zone.runOutsideAngular(()=>{
this._eventArr.forEach(eventStr => {
this._graph.off(eventStr);
this._graph.on(eventStr, params => this._handleEvent(params, eventStr));
})
})
}