From c4ba746fdee40acf3f93500fa191bad1f61704ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Sat, 17 Feb 2018 21:56:02 +0800 Subject: [PATCH] no message Former-commit-id: a4a8834f03829261665d2d461053dcec5e89bcc7 Former-commit-id: 43fd54234417b238873d9f83d9f6ceb2be533ef6 Former-commit-id: 5f9a2876151a60a490d1f15e294cb1ecccf45281 --- src/components/charts/G2/mixins/G2.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/charts/G2/mixins/G2.js b/src/components/charts/G2/mixins/G2.js index 14b46587..2b32ef25 100644 --- a/src/components/charts/G2/mixins/G2.js +++ b/src/components/charts/G2/mixins/G2.js @@ -29,14 +29,20 @@ export default { }, mounted () { // 如果设置了在 mounted 后自动初始化 就在这里初始化 - if (this.autoInit) { - this.init() - } + setTimeout(() => { + if (this.autoInit) { + this.$nextTick(() => { + this.init() + }) + } + }, 300) }, watch: { // 数据改变 data () { - this.changeData() + this.$nextTick(() => { + this.changeData() + }) } }, methods: {