From b537dd0f7f276b35e2b515d7880ad2002d6c079a Mon Sep 17 00:00:00 2001 From: QIU Date: Tue, 7 Oct 2025 08:36:53 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/comment/Twikoo.astro | 22 +++++++++++++++++++--- src/layouts/Layout.astro | 11 ++++++++++- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/components/comment/Twikoo.astro b/src/components/comment/Twikoo.astro index 65be396..c87450b 100644 --- a/src/components/comment/Twikoo.astro +++ b/src/components/comment/Twikoo.astro @@ -13,7 +13,23 @@ const config = { ---
- - diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 1d8b2a6..714f846 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -378,6 +378,7 @@ function init() { loadHue(); initCustomScrollbar(); showBanner(); + initCommentComponent(); // 调用initCommentComponent()函数,twikoo } /* Load settings when entering the site */ @@ -413,7 +414,15 @@ const setup = () => { navbar.classList.add('navbar-hidden') } }) - window.swup.hooks.on('content:replace', initCustomScrollbar) + // window.swup.hooks.on('content:replace', initCustomScrollbar) + + window.swup.hooks.on("content:replace", () => { + + initCustomScrollbar(); + + initCommentComponent(); // 添加代码调用 + + }); window.swup.hooks.on('visit:start', (visit: {to: {url: string}}) => { // change banner height immediately when a link is clicked const bodyElement = document.querySelector('body')