From 707b1ea79680949571a2dd923d1412bb1a3d5fcc Mon Sep 17 00:00:00 2001 From: whyczyk <525500596@qq.com> Date: 星期四, 04 三月 2021 15:00:11 +0800 Subject: [PATCH] 拖拽size优化 --- src/components/charts/abeamProChart.vue | 7 +++++-- src/components/charts/prossPieChart.vue | 7 +++++-- src/components/charts/imgPieChart.vue | 7 +++++-- src/components/charts/latticeBar.vue | 7 +++++-- src/components/charts/triangleBarChart.vue | 7 +++++-- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/components/charts/abeamProChart.vue b/src/components/charts/abeamProChart.vue index fdaf635..ecd61a1 100644 --- a/src/components/charts/abeamProChart.vue +++ b/src/components/charts/abeamProChart.vue @@ -171,8 +171,11 @@ this.setOption(option); }, resize() { - this.$options.chart.resize(); - this.setData(this.$options.chartData); + let timers = null; + timers = setTimeout(() => { + this.$options.chart.resize(); + this.setData(this.$options.chartData); + }, 300) } }, mounted() { diff --git a/src/components/charts/imgPieChart.vue b/src/components/charts/imgPieChart.vue index 40ec934..1a81652 100644 --- a/src/components/charts/imgPieChart.vue +++ b/src/components/charts/imgPieChart.vue @@ -172,8 +172,11 @@ this.setOption(option); }, resize() { - this.$options.chart.resize(); - this.setData(this.$options.chartData); + let timers = null; + timers = setTimeout(() => { + this.$options.chart.resize(); + this.setData(this.$options.chartData); + }, 300) } }, mounted() { diff --git a/src/components/charts/latticeBar.vue b/src/components/charts/latticeBar.vue index c4a97a6..b61989c 100644 --- a/src/components/charts/latticeBar.vue +++ b/src/components/charts/latticeBar.vue @@ -166,8 +166,11 @@ this.setOption(option); }, resize() { - this.$options.chart.resize(); - this.setData(this.$options.chartData); + let timers = null; + timers = setTimeout(() => { + this.$options.chart.resize(); + this.setData(this.$options.chartData); + }, 300) } }, mounted() { diff --git a/src/components/charts/prossPieChart.vue b/src/components/charts/prossPieChart.vue index f90b15e..c37f838 100644 --- a/src/components/charts/prossPieChart.vue +++ b/src/components/charts/prossPieChart.vue @@ -170,8 +170,11 @@ this.setOption(option); }, resize() { - this.$options.chart.resize(); - this.setData(this.$options.chartData); + let timers = null; + timers = setTimeout(() => { + this.$options.chart.resize(); + this.setData(this.$options.chartData); + }, 300) }, }, mounted() { diff --git a/src/components/charts/triangleBarChart.vue b/src/components/charts/triangleBarChart.vue index f230114..02f4423 100644 --- a/src/components/charts/triangleBarChart.vue +++ b/src/components/charts/triangleBarChart.vue @@ -168,8 +168,11 @@ this.setOption(option); }, resize() { - this.$options.chart.resize(); - this.setData(this.$options.chartData); + let timers = null; + timers = setTimeout(() => { + this.$options.chart.resize(); + this.setData(this.$options.chartData); + }, 300) } }, mounted() { -- Gitblit v1.9.1