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: {