MenuGruop高亮
This commit is contained in:
tangly1024
2021-12-07 12:40:36 +08:00
parent 97266b130f
commit 1c31109663

View File

@@ -25,7 +25,7 @@ const MenuButtonGroup = ({ allowCollapse = false }) => {
<div className='leading-8 text-gray-500 dark:text-gray-400'>
{links.map(link => {
if (link.show) {
const selected = router.pathname === link.to
const selected = (router.pathname === link.to) || (router.asPath === link.to)
return <Link key={link.id + link.icon} title={link.to} href={link.to} >
<a className={'py-2 px-5 hover:text-black dark:hover:text-white hover:bg-gray-100 cursor-pointer dark:hover:bg-gray-600 duration-100 flex flex-nowrap align-middle ' +
(selected ? 'font-bold bg-gray-200 dark:bg-black dark:text-white text-black ' : '')} >