There is a chart instance already initialized on the dom
There is a chart instance already initialized on the dom
当页面刷新或多次加载echarts实例时,控制台会出现There is a chart instance already initialized on the dom警告,表示该DOM实例已经被加载。
有看到网上许多解决方法,都是先定义出echarts实例,使用时判断该实例是否已被加载,虽然可以解决,但实例过多时就需要定义许多相对来说就比较麻烦。下面的这个方法就比较简单,不需要提前定义实例。
/
原创
2022-03-08 14:38:13 ·
1011 阅读 ·
0 评论