jigsaw icon indicating copy to clipboard operation
jigsaw copied to clipboard

graph订阅mouseover,mouseout事件容易产生性能问题

Open hpyou opened this issue 5 years ago • 0 comments

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));
            })
        })
    }

hpyou avatar Jan 15 '20 08:01 hpyou