echarts飘警告[ECharts] There is a chart instance already initialized on the dom.

在这里插入图片描述

解决办法:

if (
   //判断是否存在echarts实例化对象,如果存在则销毁
   this.myChart != null &&
   this.myChart != '' &&
   this.myChart != undefined
) {
    
    
   this.myChart.dispose()
}
var chartDom = this.$refs.chartName
this.myChart = echarts.init(chartDom)

猜你喜欢

转载自blog.csdn.net/weixin_52443895/article/details/129156096