From af8c133914aeed28c0c5db5c676d0293d8f1067d Mon Sep 17 00:00:00 2001 From: Yan Shaohang Date: Fri, 9 Sep 2022 18:06:30 +0800 Subject: [PATCH] Update echarts.ts fix:cannot re-render if dom is deleted If the chart is opened in the pop-up window, opening the chart again will not display properly. --- src/composables/echarts.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/composables/echarts.ts b/src/composables/echarts.ts index 98e31da8..8bbd4490 100644 --- a/src/composables/echarts.ts +++ b/src/composables/echarts.ts @@ -130,6 +130,10 @@ export function useEcharts( const stopSizeWatch = watch([width, height], ([newWidth, newHeight]) => { initialSize.width = newWidth; initialSize.height = newHeight; + if (newWidth === 0 && newHeight === 0) { + // 节点被删除 将chart置为空 + chart = null + } if (canRender()) { if (!isRendered()) { render();