From c0c18e3fbed13f4403ec596fe6040d15d3c60ff6 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 31 Jan 2024 21:42:26 +0800 Subject: [PATCH] =?UTF-8?q?NAV=E4=B8=BB=E9=A2=98=20=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/nav/components/Footer.js | 2 +- themes/nav/components/MenuItem.js | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/themes/nav/components/Footer.js b/themes/nav/components/Footer.js index 68750316..16215379 100755 --- a/themes/nav/components/Footer.js +++ b/themes/nav/components/Footer.js @@ -17,7 +17,7 @@ const Footer = ({ siteInfo }) => { © {`${copyrightDate}`} -
Powered By NotionNext
+
Powered By NotionNext {siteConfig('VERSION')}
{siteConfig('BEI_AN') && <> {siteConfig('BEI_AN')}
} diff --git a/themes/nav/components/MenuItem.js b/themes/nav/components/MenuItem.js index f1b1acc1..848bef9b 100644 --- a/themes/nav/components/MenuItem.js +++ b/themes/nav/components/MenuItem.js @@ -21,8 +21,8 @@ export const MenuItem = ({ link }) => { } // #号加标题 快速跳转到指定锚点 - const url = link?.to && link?.to !=='#' ? link.to : ('#' + link.name) - console.log(link,url , '#' + link.name) + const isAnchor = link?.to === '#' + const url = isAnchor ? ('#' + link.name) : link.to return <> {/* 菜单 */} @@ -33,7 +33,7 @@ export const MenuItem = ({ link }) => { {link?.subMenus ? (<> - {link?.icon && }{link?.title} + {link?.title}
@@ -41,23 +41,25 @@ export const MenuItem = ({ link }) => { ) : ( - {link?.icon && }{link?.title} + {link?.title} ) }
- {/* 菜单按钮 */} + {/* 子菜单按钮 */} {link?.subMenus && ( { link?.subMenus?.map((sLink, index) => { - // #号加标题 快速跳转到指定锚点 - const sUrl = sLink?.to && sLink?.to.length !=='#' ? sLink.to : ('#' + sLink.name) - return
+ // #号加标题 快速跳转到指定锚点 + const sIsAnchor = sLink?.to === '#' + const sUrl = sIsAnchor ? sLink.to : ('#' + sLink.name) + return
- {sLink.title} + + {sLink.title}
})