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

多次渲染数据,上次的数据不会清空 #81

Open
jinjiaxing opened this issue Jan 13, 2020 · 6 comments
Open

多次渲染数据,上次的数据不会清空 #81

jinjiaxing opened this issue Jan 13, 2020 · 6 comments

Comments

@jinjiaxing
Copy link

加载一次数据后,渲染图形完成

在去请求server重新请求数据,再次渲染这个图形

则上次的绘制的图形不会被清空,调用clear等方法均无效,怎么解决?

@F-loat
Copy link
Owner

F-loat commented Jan 13, 2020

可以参考下延迟加载图表那个示例

@jinjiaxing
Copy link
Author

可以参考下延迟加载图表那个示例

无效啊,this.$refs.echarts.init() 直接init of null了, ref也设置了

@F-loat
Copy link
Owner

F-loat commented Jan 13, 2020

我那个示例跑起来没问题呀

@jinjiaxing
Copy link
Author

我那个示例跑起来没问题呀

我试了下你那个,其实跟版本也有关系,我的mpvue版本都比较新,也就没办法使用init方法

想问下,除了这个,还有什么办法可以直接重新初始化你这个组件呢?我不想进行setOptions了,
我想整个刷新

@jinjiaxing
Copy link
Author

发现canvas实例对象无法销毁,造成这个问题,是否可以留出一个接口,让可以清空canvas

@F-loat
Copy link
Owner

F-loat commented Jan 15, 2020

可以来个 pr

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

2 participants