Skip to content

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

@hpyou

Description

@hpyou

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions