首页 > 其他 > 详细

vue Ehcarts There is a chart instance already initialized on the dom.

时间:2019-02-12 10:13:51      阅读:999      评论:0      收藏:0      [点我收藏+]

使用Echarts插件的时候,多次加载会出现There is a chart instance already initialized on the dom.这个错误,改插件已经加载完成。

解决方法:

在data()定义全局变量

data(){
return{
myChart=null
}
}

在使用插件方法中最前面添加

if (this.myChart != null && this.myChart!= "" && this.myChart!= undefined) {
this.myChart.dispose();
}

然后在实例化

this.myChart = echarts.init(document.getElementById(‘sjtjt‘));

vue Ehcarts There is a chart instance already initialized on the dom.

原文:https://www.cnblogs.com/GentleKBP/p/10363903.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!