Kaynağa Gözat

fix: chart instance disposal condition

dom has been disposed in vue3 v-if,but chartInstance exist
Qiu 4 ay önce
ebeveyn
işleme
3862942e9f

+ 2 - 1
packages/effects/plugins/src/echarts/use-echarts.ts

@@ -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;
           }