import { siteConfig } from '@/lib/config' import { useGlobal } from '@/lib/global' import { useGameGlobal } from '..' import CONFIG from '../config' import DarkModeButton from './DarkModeButton' import { MenuItemDrop } from './MenuItemDrop' /** * 导航菜单 */ export const MenuList = props => { const { setSideBarVisible } = useGameGlobal() const { customNav, customMenu } = props const { locale } = useGlobal() const defaultLinks = [ { id: 1, icon: 'fas fa-home', name: locale.NAV.INDEX, to: '/' || '/', show: true }, { id: 2, icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('GAME_MENU_CATEGORY', null, CONFIG) }, { id: 3, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('GAME_MENU_TAG', null, CONFIG) } ] let links = [].concat(defaultLinks) if (customNav) { links = defaultLinks.concat(customNav) } // 如果 开启自定义菜单,则覆盖Page生成的菜单 if (siteConfig('CUSTOM_MENU')) { links = customMenu } return (