From 6f46cff40ea7ea956e7faf6677d3ef445918eed7 Mon Sep 17 00:00:00 2001 From: jinchao <383321154@qq.com> Date: Tue, 10 Jun 2025 15:26:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=B9=9F=E5=AF=BC=E8=87=B4=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XNSimHtml/components/data-monitor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/XNSimHtml/components/data-monitor.js b/XNSimHtml/components/data-monitor.js index f41e406..73b4b4c 100644 --- a/XNSimHtml/components/data-monitor.js +++ b/XNSimHtml/components/data-monitor.js @@ -1180,7 +1180,9 @@ class DataMonitor extends HTMLElement { disconnectedCallback() { this.isActive = false; // 清理所有图表窗口 - this.chartWindows.forEach(window => { + this.chartWindows.forEach((window, windowId) => { + // 触发关闭事件,确保所有清理工作都完成 + window.dispatchEvent(new CustomEvent('close')); window.remove(); }); this.chartWindows.clear();