From ca26dae20f648e5f6ea7bb6cb57f062914952d0e Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 9 Feb 2023 16:34:32 +0800 Subject: [PATCH] =?UTF-8?q?medium=20=E5=9B=9E=E9=A1=B6=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/medium/LayoutBase.js | 4 +++- themes/medium/LayoutSlug.js | 2 +- themes/medium/components/Catalog.js | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/themes/medium/LayoutBase.js b/themes/medium/LayoutBase.js index 8741679e..3f2bff0c 100644 --- a/themes/medium/LayoutBase.js +++ b/themes/medium/LayoutBase.js @@ -41,13 +41,15 @@ const LayoutBase = props => {
{slotTop} {children} + + {/* 回顶按钮 */}
+ className='fixed xl:right-80 right-2 mr-6 bottom-24 hidden lg:block z-20'> { window.scrollTo({ top: 0, behavior: 'smooth' }) }}/>
diff --git a/themes/medium/LayoutSlug.js b/themes/medium/LayoutSlug.js index c3cc0423..6000c3f3 100644 --- a/themes/medium/LayoutSlug.js +++ b/themes/medium/LayoutSlug.js @@ -67,7 +67,7 @@ export const LayoutSlug = props => { {/* Notion文章主体 */} -
+
{post && ()}
diff --git a/themes/medium/components/Catalog.js b/themes/medium/components/Catalog.js index f9499506..11b8cae0 100644 --- a/themes/medium/components/Catalog.js +++ b/themes/medium/components/Catalog.js @@ -28,7 +28,6 @@ const Catalog = ({ toc }) => { const throttleMs = 100 const actionSectionScrollSpy = React.useCallback(throttle(() => { - console.log('滚动') const sections = document.getElementsByClassName('notion-h') let prevBBox = null let currentSectionId = activeSection