From 42fcb9e7cc2c9f23e35db0e1c16db2c776329baa Mon Sep 17 00:00:00 2001 From: guoyue Date: Thu, 30 Jun 2022 10:39:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=95=B0=E6=8D=AE=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E6=B8=B2=E6=9F=93=E4=B8=8D=E5=87=BA=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workBench/components/dept-chart-view.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/back/src/views/modules/workBench/components/dept-chart-view.vue b/back/src/views/modules/workBench/components/dept-chart-view.vue index c35139ec..fd740ca1 100644 --- a/back/src/views/modules/workBench/components/dept-chart-view.vue +++ b/back/src/views/modules/workBench/components/dept-chart-view.vue @@ -17,9 +17,6 @@ export default { myChart: null, } }, - mounted() { - this.init() - }, props: { id: { type: String, @@ -40,7 +37,10 @@ export default { if (newVal) { this.dataListCopy = newVal; if (document.getElementById(this.id)) { - this.init() + // 解决数据初始渲染不出来的问题 + setTimeout(() => { + this.initChart() + }, 1000) } } }, @@ -48,8 +48,13 @@ export default { immediate: true }, }, + mounted() { + setTimeout(() => { + this.initChart() + }, 1000) + }, methods: { - init() { + initChart() { var chartDom = document.getElementById(this.id); if (this.myChart) { this.myChart.dispose()