修复切换标签也导致的bug

This commit is contained in:
jinchao 2025-06-10 15:26:31 +08:00
parent 1452ac2dad
commit 6f46cff40e

View File

@ -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();