slug 调整兼容已有主题

This commit is contained in:
tangly1024.com
2024-05-08 16:22:14 +08:00
parent 65eff434ec
commit 9b78eb499c
56 changed files with 1318 additions and 826 deletions

View File

@@ -9,19 +9,21 @@ export const NormalMenu = props => {
return null
}
const selected = (router.pathname === link.to) || (router.asPath === link.to)
const selected = router.pathname === link.href || router.asPath === link.href
return <Link
key={`${link.to}`}
title={link.to}
href={link.to}
className={'py-0.5 duration-500 justify-between text-gray-500 dark:text-gray-300 hover:text-black hover:underline cursor-pointer flex flex-nowrap items-center ' +
(selected ? 'text-black' : ' ')}>
<div className='my-auto items-center justify-center flex '>
<div className={ 'hover:text-black'}>{link.name}</div>
</div>
{link.slot}
</Link>
return (
<Link
key={`${link.href}`}
title={link.href}
href={link.href}
className={
'py-0.5 duration-500 justify-between text-gray-500 dark:text-gray-300 hover:text-black hover:underline cursor-pointer flex flex-nowrap items-center ' +
(selected ? 'text-black' : ' ')
}>
<div className='my-auto items-center justify-center flex '>
<div className={'hover:text-black'}>{link.name}</div>
</div>
{link.slot}
</Link>
)
}