Skip to content

Commit

Permalink
fix(core): load error while change data
Browse files Browse the repository at this point in the history
  • Loading branch information
xiguaxigua committed Jul 30, 2018
1 parent a798770 commit 3517aa5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Vue.use(Router)

export const TEST_ROUTES = [
{ path: '/columns-rows', name: 'data', component: () => import('./test/columns-rows.vue') },
{ path: '/load', name: 'load', component: () => import('./test/load.vue') },
{ path: '/custom-props', name: 'options', component: () => import('./test/custom-props.vue') },
{ path: '/events', name: 'events', component: () => import('./test/events.vue') },
{ path: '/extend', name: 'extend', component: () => import('./test/extend.vue') },
Expand Down
26 changes: 26 additions & 0 deletions examples/test/load.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div>
<button @click="load">加载数据</button>
<ve-line :data="chartData"></ve-line>
</div>
</template>

<script>
import { VeLine } from '../../src/index.es'
import { LINE_DATA } from '../test/data'
export default {
data () {
return {
chartData: []
}
},
methods: {
load () {
setTimeout(_ => {
this.chartData = LINE_DATA
}, 1000)
}
},
components: { VeLine }
}
</script>
1 change: 1 addition & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ export default {
setOptionOpts = false
}
}
if (this._isDestroyed) return
this.echarts.setOption(options, setOptionOpts)
this.$emit('ready', this.echarts, options, echartsLib)
if (!this._once['ready-once']) {
Expand Down

0 comments on commit 3517aa5

Please sign in to comment.