fix link null

This commit is contained in:
tangly1024
2022-12-07 22:39:29 +08:00
parent 62ff011816
commit e76aa37d9f

View File

@@ -55,7 +55,7 @@ export default function TopNavBar(props) {
{/* 顶部菜单 */}
<div className='hidden md:flex'>
{navs && navs.map(link => {
if (link.show) {
if (link?.show) {
const selected = (router.pathname === link.to) || (router.asPath === link.to)
return <Link key={`${link.id}-${link.to}`} title={link.to} href={link.to} >
<a target={link.to.indexOf('http') === 0 ? '_blank' : '_self'} className={'px-2 duration-300 text-sm justify-between dark:text-gray-300 cursor-pointer flex flex-nowrap items-center ' +