From 3841f9fdacaabd8c9c476d157a2079ee46a679fa Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Fri, 15 Oct 2021 15:02:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E8=8F=9C=E5=8D=95=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/JumpToTop.js | 2 +- components/MenuButtonGroup.js | 2 +- components/SideBar.js | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/components/JumpToTop.js b/components/JumpToTop.js index 3dfcd209..4ead6b10 100644 --- a/components/JumpToTop.js +++ b/components/JumpToTop.js @@ -16,7 +16,7 @@ const JumpToTop = ({ targetRef, showPercent = true }) => { const [percent, changePercent] = useState(0) const scrollListener = useCallback(throttle(() => { // 处理是否显示回到顶部按钮 - const clientHeight = targetRef ? (targetRef.current.clientHeight) : 0 + const clientHeight = targetRef ? (targetRef.current ? targetRef.current.clientHeight : 0) : 0 const scrollY = window.pageYOffset const fullHeight = clientHeight - window.outerHeight const shouldShow = scrollY > 100 diff --git a/components/MenuButtonGroup.js b/components/MenuButtonGroup.js index 37100c01..cf349c2e 100644 --- a/components/MenuButtonGroup.js +++ b/components/MenuButtonGroup.js @@ -29,7 +29,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => {
-
{link.name}
+
{link.name}
) )} diff --git a/components/SideBar.js b/components/SideBar.js index fd641d46..450e0ba8 100644 --- a/components/SideBar.js +++ b/components/SideBar.js @@ -8,11 +8,9 @@ const SideBar = ({ tags, currentTag, post }) => {