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