From 8b717ad209977d0c8ddcde6e0bbeebddc7211719 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sun, 25 Dec 2022 20:57:00 +0800 Subject: [PATCH] =?UTF-8?q?toc=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/matery/LayoutSlug.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/themes/matery/LayoutSlug.js b/themes/matery/LayoutSlug.js index b0e775a5..f11a2703 100644 --- a/themes/matery/LayoutSlug.js +++ b/themes/matery/LayoutSlug.js @@ -18,7 +18,6 @@ export const LayoutSlug = props => { const scrollListener = () => { const scrollY = window.pageYOffset const shouldShow = scrollY > 220 && post?.toc?.length > 0 - if (shouldShow !== show) { switchShow(shouldShow) } @@ -46,7 +45,7 @@ export const LayoutSlug = props => { >
-
+
{lock && } @@ -91,17 +90,23 @@ export const LayoutSlug = props => {
}
{post.type === 'Post' && } + + {post?.toc?.length > 0 &&
+
+
+
+ +
+
+
+
} +
-
-
- {show && } -
-