From dc281c1033308ced4efd20dd60d40ee19b7ac11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Tue, 29 Oct 2024 11:20:48 +0800 Subject: [PATCH] Update Artalk.astro --- src/components/Artalk.astro | 39 +++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/components/Artalk.astro b/src/components/Artalk.astro index 4e09b8d..56394da 100644 --- a/src/components/Artalk.astro +++ b/src/components/Artalk.astro @@ -6,13 +6,18 @@ const { site, server } = Astro.props;
+ + // 使用 MutationObserver(可选) + const observer = new MutationObserver(() => { + initializeArtalk(document); + }); + + // 开始观察 + observer.observe(document.getElementById('Comments'), { + childList: true, + subtree: true + }); + \ No newline at end of file