Browse Source

去除数据缓存

martin.ma 4 years ago
parent
commit
98c705ee05
1 changed files with 5 additions and 2 deletions
  1. 5 2
      components/Echart/line.vue

+ 5 - 2
components/Echart/line.vue

@@ -68,7 +68,10 @@ export default {
     },
     methods: {
         initEcharts() {
-            this.myChart = echarts.init(document.getElementById('echarts'));
+            if(!this.myChart){
+                this.myChart = echarts.init(document.getElementById('echarts'));
+            }
+            
             this.myChart.resize({
                 width: this.width,
                 height: this.height
@@ -92,7 +95,7 @@ export default {
                 },
                 yAxis: {},
                 series: [...this.seriesParse]
-            });
+            },true);
         }
     }
 }