1
- import { useGlobal } from '@/lib/global'
2
1
import { siteConfig } from '@/lib/config'
3
- import { MenuItemCollapse } from './MenuItemCollapse '
2
+ import { useGlobal } from '@/lib/global '
4
3
import CONFIG from '../config'
5
-
6
- export const MenuListSide = ( props ) => {
4
+ import { MenuItemCollapse } from './MenuItemCollapse'
5
+ /**
6
+ * 侧拉抽屉菜单
7
+ * @param {* } props
8
+ * @returns
9
+ */
10
+ export const MenuListSide = props => {
7
11
const { customNav, customMenu } = props
8
12
const { locale } = useGlobal ( )
9
13
10
14
let links = [
11
- { icon : 'fas fa-archive' , name : locale . NAV . ARCHIVE , to : '/archive' , show : siteConfig ( 'HEXO_MENU_ARCHIVE' , null , CONFIG ) } ,
12
- { icon : 'fas fa-search' , name : locale . NAV . SEARCH , to : '/search' , show : siteConfig ( 'HEXO_MENU_SEARCH' , null , CONFIG ) } ,
13
- { icon : 'fas fa-folder' , name : locale . COMMON . CATEGORY , to : '/category' , show : siteConfig ( 'HEXO_MENU_CATEGORY' , null , CONFIG ) } ,
14
- { icon : 'fas fa-tag' , name : locale . COMMON . TAGS , to : '/tag' , show : siteConfig ( 'HEXO_MENU_TAG' , null , CONFIG ) }
15
+ {
16
+ icon : 'fas fa-archive' ,
17
+ name : locale . NAV . ARCHIVE ,
18
+ to : '/archive' ,
19
+ show : siteConfig ( 'HEXO_MENU_ARCHIVE' , null , CONFIG )
20
+ } ,
21
+ {
22
+ icon : 'fas fa-search' ,
23
+ name : locale . NAV . SEARCH ,
24
+ to : '/search' ,
25
+ show : siteConfig ( 'HEXO_MENU_SEARCH' , null , CONFIG )
26
+ } ,
27
+ {
28
+ icon : 'fas fa-folder' ,
29
+ name : locale . COMMON . CATEGORY ,
30
+ to : '/category' ,
31
+ show : siteConfig ( 'HEXO_MENU_CATEGORY' , null , CONFIG )
32
+ } ,
33
+ {
34
+ icon : 'fas fa-tag' ,
35
+ name : locale . COMMON . TAGS ,
36
+ to : '/tag' ,
37
+ show : siteConfig ( 'HEXO_MENU_TAG' , null , CONFIG )
38
+ }
15
39
]
16
40
17
41
if ( customNav ) {
@@ -34,8 +58,10 @@ export const MenuListSide = (props) => {
34
58
}
35
59
36
60
return (
37
- < nav >
38
- { links ?. map ( ( link , index ) => < MenuItemCollapse key = { index } link = { link } /> ) }
39
- </ nav >
61
+ < nav >
62
+ { links ?. map ( ( link , index ) => (
63
+ < MenuItemCollapse key = { index } link = { link } />
64
+ ) ) }
65
+ </ nav >
40
66
)
41
67
}
0 commit comments