fix: resize tempchart on window resize event (#750)
This commit is contained in:
parent
d830493acc
commit
b521b1cd1e
@ -228,11 +228,19 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
|
||||
mounted() {
|
||||
this.initChart()
|
||||
|
||||
window.addEventListener('resize', this.eventListenerResize)
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
if (typeof window === 'undefined') return
|
||||
if (this.chart) this.chart.dispose()
|
||||
|
||||
window.removeEventListener('resize', this.eventListenerResize)
|
||||
}
|
||||
|
||||
eventListenerResize() {
|
||||
this.chart?.resize()
|
||||
}
|
||||
|
||||
initChart() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user