From 5c9be310bd49bb96f240ea49b736943ed0ce2be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Thu, 5 Oct 2023 14:05:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A2=AB=E7=A7=BB=E9=99=A4=E6=97=B6=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E7=9B=91=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/weigets.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/weigets.js b/public/weigets.js index c56cbbd..a2fed08 100644 --- a/public/weigets.js +++ b/public/weigets.js @@ -94,8 +94,9 @@ export function Dialog(options) { } } }) - // 监听 Dialog 元素的插入 + // 监听 Dialog 元素的插入, 在 Dialog 被移除时停止监听 observer.observe(document.body, { childList: true, subtree: true }) + element.onremove = () => observer.disconnect() return element }