slug调整 兼容commerce主题

This commit is contained in:
tangly1024.com
2024-05-08 15:22:01 +08:00
parent b1b38bcde8
commit 7db60ffa10
8 changed files with 179 additions and 77 deletions

View File

@@ -1,17 +1,37 @@
import { useGlobal } from '@/lib/global'
import { siteConfig } from '@/lib/config'
import { MenuItemCollapse } from './MenuItemCollapse'
import { useGlobal } from '@/lib/global'
import CONFIG from '../config'
import { MenuItemCollapse } from './MenuItemCollapse'
export const MenuListSide = (props) => {
export const MenuListSide = props => {
const { customNav, customMenu } = props
const { locale } = useGlobal()
let links = [
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE },
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH },
{ icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG }
{
icon: 'fas fa-archive',
name: locale.NAV.ARCHIVE,
href: '/archive',
show: CONFIG.MENU_ARCHIVE
},
{
icon: 'fas fa-search',
name: locale.NAV.SEARCH,
href: '/search',
show: CONFIG.MENU_SEARCH
},
{
icon: 'fas fa-folder',
name: locale.COMMON.CATEGORY,
href: '/category',
show: CONFIG.MENU_CATEGORY
},
{
icon: 'fas fa-tag',
name: locale.COMMON.TAGS,
href: '/tag',
show: CONFIG.MENU_TAG
}
]
if (customNav) {
@@ -34,9 +54,11 @@ export const MenuListSide = (props) => {
}
return (
<nav>
{/* {links.map(link => <MenuItemNormal key={link?.id} link={link} />)} */}
{links?.map(link => <MenuItemCollapse key={link?.id} link={link} />)}
</nav>
<nav>
{/* {links.map(link => <MenuItemNormal key={link?.id} link={link} />)} */}
{links?.map(link => (
<MenuItemCollapse key={link?.id} link={link} />
))}
</nav>
)
}