细节优化

This commit is contained in:
tangly1024.com
2023-03-10 17:41:22 +08:00
parent 7c0907fff8
commit 4e9b9a09cf
3 changed files with 17 additions and 22 deletions

View File

@@ -1,15 +0,0 @@
import { useGlobal } from '@/lib/global'
/**
* 一个全页面遮罩,当发生页面跳转时出现。
* @param {*} props
* @returns
*/
export const Cover = (props) => {
const { onLoading } = useGlobal()
return <div id='cover-loading' className={`${onLoading ? 'z-50 opacity-20' : '-z-10 opacity-0'} pointer-events-none transition-all duration-300 bg-black fixed top-0 left-0 h-screen w-screen `}>
<div className='w-screen h-screen flex justify-center items-center'>
<i className="fa-solid fa-spinner text-2xl text-white animate-spin"> </i>
</div>
</div>
}

View File

@@ -23,7 +23,7 @@ export const NavBarMenu = ({ customNav, customMenu }) => {
}
const router = useRouter()
useEffect(() => {
router.events.on('routeChangeComplete', closeMenu)
router.events.on('routeChangeStart', closeMenu)
})
let links = [