Skip to content

Commit

Permalink
Fix beforeDestory when renderChart was not called
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangYiJiang committed Jul 4, 2017
1 parent 362639c commit 3e423fd
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/BaseCharts/Bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/Bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/Doughnut.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/HorizontalBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/Pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/PolarArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/Radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})
4 changes: 3 additions & 1 deletion src/BaseCharts/Scatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export default Vue.extend({
}
},
beforeDestroy () {
this._chart.destroy()
if (this._chart) {
this._chart.destroy()
}
}
})

0 comments on commit 3e423fd

Please sign in to comment.