From 3e3cc7c4341584f8db19002ad4ed7de8a4b85a93 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Thu, 9 Feb 2023 12:49:34 +0800 Subject: [PATCH] =?UTF-8?q?medium=20=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/DarkModeButton.js | 4 ++-- themes/medium/LayoutBase.js | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/components/DarkModeButton.js b/components/DarkModeButton.js index a4d36989..2b8cd5b8 100644 --- a/components/DarkModeButton.js +++ b/components/DarkModeButton.js @@ -13,8 +13,8 @@ const DarkModeButton = (props) => { htmlElement.classList?.add(newStatus ? 'dark' : 'light') } - return
- +
} diff --git a/themes/medium/LayoutBase.js b/themes/medium/LayoutBase.js index 758cd806..8741679e 100644 --- a/themes/medium/LayoutBase.js +++ b/themes/medium/LayoutBase.js @@ -41,6 +41,15 @@ const LayoutBase = props => {
{slotTop} {children} +
+ { window.scrollTo({ top: 0, behavior: 'smooth' }) }}/> +
{/* 底部 */} @@ -63,10 +72,6 @@ const LayoutBase = props => { -
- -
-