From 1ade809e056aeb8a582cb29f7b604a5663eb6e55 Mon Sep 17 00:00:00 2001 From: sc Date: Fri, 4 Jun 2021 13:17:07 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20scEcharts=20=E5=9B=A0activated=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=8A=A8=E7=94=BB=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scEcharts/index.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/scEcharts/index.vue b/src/components/scEcharts/index.vue index 30b5f400..b0458d6f 100644 --- a/src/components/scEcharts/index.vue +++ b/src/components/scEcharts/index.vue @@ -19,6 +19,7 @@ }, data() { return { + isActivat: false, myChart: null } }, @@ -36,11 +37,17 @@ } }, activated(){ - this.$nextTick(() => { - this.myChart.resize() - }) + if(!this.isActivat){ + this.$nextTick(() => { + this.myChart.resize() + }) + } + }, + deactivated(){ + this.isActivat = false; }, mounted(){ + this.isActivat = true; this.draw(); }, methods: {