소스 검색

fix: chart instance disposal condition

dom has been disposed in vue3 v-if,but chartInstance exist
Qiu 4 달 전
부모
커밋
3862942e9f
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/effects/plugins/src/echarts/use-echarts.ts

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