fix: chart instance disposal condition

dom has been disposed in vue3 v-if,but chartInstance exist
pull/324/head
Qiu 2026-01-21 11:47:01 +08:00 committed by GitHub
parent 59aabd956d
commit 3862942e9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -92,7 +92,8 @@ function useEcharts(chartRef: Ref<EchartsUIType>) {
return;
}
useTimeoutFn(() => {
if (!chartInstance) {
if (!chartInstance || chartInstance?.getDom() !== el) {
chartInstance?.dispose();
const instance = initCharts();
if (!instance) return;
}