From c4a7fa3b8611beeae3815c93567ba0af72225e75 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 8 Dec 2021 13:07:24 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E5=AF=BC=E8=88=AA=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E7=82=B9=E5=87=BB=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/SideBarDrawer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js index 8e9f9c1b..30e96a6a 100644 --- a/components/SideBarDrawer.js +++ b/components/SideBarDrawer.js @@ -16,12 +16,13 @@ const SideBarDrawer = ({ post, currentTag, cRef, tags, posts, categories, curren const [isShow, changeHiddenStatus] = useState(false) // 点击按钮更改侧边抽屉状态 const switchSideDrawerVisible = () => { - changeHiddenStatus(!isShow) + const showStatus = !isShow + changeHiddenStatus(showStatus) if (window) { const sideBarDrawer = window.document.getElementById('sidebar-drawer') const sideBarDrawerBackground = window.document.getElementById('sidebar-drawer-background') - if (isShow) { + if (showStatus) { sideBarDrawer.classList.replace('-ml-72', 'ml-0') sideBarDrawerBackground.classList.replace('hidden', 'block') } else {