Skip to content

Commit 3307b6b

Browse files
committed
fix: nativeView 'undefined' error caused by scheduled interval.
1 parent ea3cd68 commit 3307b6b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

demo_vue/app/examples/Realtime.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,14 @@ export default Vue.extend({
109109
}
110110
},
111111
addEntry() {
112-
const chart = this.$refs.chart['nativeView'] as LineChart;
112+
// In case user leaves this page
113+
if (!this.$refs.chart)
114+
{
115+
this.stop();
116+
return;
117+
}
113118
119+
const chart = this.$refs.chart['nativeView'] as LineChart;
114120
const data = chart.getData();
115121
116122
if (data != null) {

0 commit comments

Comments
 (0)