Skip to content

Commit b23ce23

Browse files
committed
Merge branch 'develop' of github.com:apertureless/vue-chartjs into develop
* 'develop' of github.com:apertureless/vue-chartjs: Fix beforeDestory when renderChart was not called
2 parents 7f62914 + 677c53d commit b23ce23

File tree

9 files changed

+27
-9
lines changed

9 files changed

+27
-9
lines changed

src/BaseCharts/Bar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ export default Vue.extend({
7979
}
8080
},
8181
beforeDestroy () {
82-
this._chart.destroy()
82+
if (this._chart) {
83+
this._chart.destroy()
84+
}
8385
}
8486
})

src/BaseCharts/Bubble.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export default Vue.extend({
8080
}
8181
},
8282
beforeDestroy () {
83-
this._chart.destroy()
83+
if (this._chart) {
84+
this._chart.destroy()
85+
}
8486
}
8587
})

src/BaseCharts/Doughnut.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default Vue.extend({
6363
}
6464
},
6565
beforeDestroy () {
66-
this._chart.destroy()
66+
if (this._chart) {
67+
this._chart.destroy()
68+
}
6769
}
6870
})

src/BaseCharts/HorizontalBar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ export default Vue.extend({
7979
}
8080
},
8181
beforeDestroy () {
82-
this._chart.destroy()
82+
if (this._chart) {
83+
this._chart.destroy()
84+
}
8385
}
8486
})

src/BaseCharts/Line.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export default Vue.extend({
7878
}
7979
},
8080
beforeDestroy () {
81-
this._chart.destroy()
81+
if (this._chart) {
82+
this._chart.destroy()
83+
}
8284
}
8385
})

src/BaseCharts/Pie.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default Vue.extend({
6363
}
6464
},
6565
beforeDestroy () {
66-
this._chart.destroy()
66+
if (this._chart) {
67+
this._chart.destroy()
68+
}
6769
}
6870
})

src/BaseCharts/PolarArea.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default Vue.extend({
6363
}
6464
},
6565
beforeDestroy () {
66-
this._chart.destroy()
66+
if (this._chart) {
67+
this._chart.destroy()
68+
}
6769
}
6870
})

src/BaseCharts/Radar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default Vue.extend({
6363
}
6464
},
6565
beforeDestroy () {
66-
this._chart.destroy()
66+
if (this._chart) {
67+
this._chart.destroy()
68+
}
6769
}
6870
})

src/BaseCharts/Scatter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export default Vue.extend({
6969
}
7070
},
7171
beforeDestroy () {
72-
this._chart.destroy()
72+
if (this._chart) {
73+
this._chart.destroy()
74+
}
7375
}
7476
})

0 commit comments

Comments
 (0)