菜单bug

This commit is contained in:
tangly1024.com
2024-02-04 17:49:18 +08:00
parent 0b91bfb211
commit e904b47e76
3 changed files with 15 additions and 6 deletions

View File

@@ -4,8 +4,6 @@ import { useRouter } from 'next/router'
export const MenuItemDrop = ({ link }) => {
const [show, changeShow] = useState(false)
// const show = true
// const changeShow = () => {}
const router = useRouter()
if (!link || !link.show) {
@@ -13,7 +11,7 @@ export const MenuItemDrop = ({ link }) => {
}
const hasSubMenu = link?.subMenus?.length > 0
const selected = (router.pathname === link.to) || (router.asPath === link.to)
console.log('link', link?.to)
return <li className='cursor-pointer list-none items-center flex mx-2' onMouseOver={() => changeShow(true)} onMouseOut={() => changeShow(false)} >
{hasSubMenu &&