Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hpyou opened this issue Jan 15, 2020 · 0 comments
Open

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

hpyou opened this issue Jan 15, 2020 · 0 comments

Comments

@hpyou
Copy link
Collaborator

hpyou commented Jan 15, 2020

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));
            })
        })
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant