import BLOG from '@/blog.config' import { useGlobal } from '@/lib/global' import CONFIG from '../config' import { MenuItemDrop } from './MenuItemDrop' /** * 菜单导航 * @param {*} props * @returns */ export const Nav = (props) => { const { customNav, customMenu } = props const { locale } = useGlobal() let links = [ { id: 1, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }, { id: 2, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE }, { id: 3, icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY }, { id: 4, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG } ] if (customNav) { links = links.concat(customNav) } // 如果 开启自定义菜单,则不再使用 Page生成菜单。 if (BLOG.CUSTOM_MENU) { links = customMenu } if (!links || links.length === 0) { return null } return ( ) }