From 7d0df4f9107d864cfc84af1e142c29a64f096ff6 Mon Sep 17 00:00:00 2001 From: anime Date: Sat, 28 Dec 2024 05:15:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E4=BF=AE=E5=A4=8D=20hash=20=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 5769bfb2886775f5b3339a76d5d6a590b67d56b5) --- components/NotionPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/NotionPage.js b/components/NotionPage.js index a3f1a085..de1f5f6b 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -150,7 +150,7 @@ const autoScrollToHash = () => { setTimeout(() => { // 跳转到指定标题 const hash = window?.location?.hash - const needToJumpToTitle = hash && hash > 0 + const needToJumpToTitle = hash && hash.length > 0 if (needToJumpToTitle) { console.log('jump to hash', hash) const tocNode = document.getElementById(hash.substring(1))