bugfix: destroy resize event before component destroy
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
1 parent
5a8a42cfdd
commit
b3e9d85701
1 file changed
+7
-3
@@ -304,14 +304,18 @@ export default {
|
||||
if(isVisible && this.chart !== null) this.chart.resize()
|
||||
if(this.chart !== null) this.updateChart()
|
||||
},
|
||||
resize() {
|
||||
this.chart?.resize();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.chart) this.chart.resize()
|
||||
})
|
||||
window.addEventListener('resize', this.resize)
|
||||
},
|
||||
mounted: function() {
|
||||
this.createChart()
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.resize);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user