mirror of
https://github.com/klinecharts/KLineChart.git
synced 2024-11-25 16:22:43 +08:00
fix: fix dispose
error
This commit is contained in:
parent
8cf36916ce
commit
74902c55a4
@ -136,8 +136,12 @@ export default class Canvas {
|
||||
}
|
||||
|
||||
destroy (): void {
|
||||
this._resizeObserver.unobserve(this._element)
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
this._mediaQueryList.removeListener(this._mediaQueryListener)
|
||||
if (isValid(this._resizeObserver)) {
|
||||
this._resizeObserver.unobserve(this._element)
|
||||
}
|
||||
if (isValid(this._mediaQueryList)) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||
this._mediaQueryList.removeListener(this._mediaQueryListener)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user