little fix

This commit is contained in:
tangly1024.com
2024-01-30 19:07:30 +08:00
parent e63e82cbba
commit 4996cfd002
4 changed files with 20 additions and 20 deletions

View File

@@ -21,7 +21,8 @@ export const MenuItem = ({ link }) => {
}
// #号加标题 快速跳转到指定锚点
const url = link?.to && link?.to.length > 0 ? link.to : '#' + link?.title
const url = link?.to && link?.to !=='#' ? link.to : ('#' + link.name)
console.log(link,url , '#' + link.name)
return <>
{/* 菜单 */}
@@ -53,7 +54,7 @@ export const MenuItem = ({ link }) => {
{
link?.subMenus?.map((sLink, index) => {
// #号加标题 快速跳转到指定锚点
const sUrl = sLink?.to && sLink?.to.length > 0 ? sLink.to : '#' + sLink?.title
const sUrl = sLink?.to && sLink?.to.length !=='#' ? sLink.to : ('#' + sLink.name)
return <div key={index} className='nav-submenu'>
<Link href={sUrl}>
<span className='dark:text-neutral-400 text-gray-500 hover:text-black dark:hover:text-white text-xs font-bold'><i className={`text-xs mr-1 ${sLink?.icon ? sLink?.icon : 'fas fa-hashtag'}`} />{sLink.title}</span>