Optimize tools route. Optimize multiple menu stylesheet.
This commit is contained in:
106
src/router/tools.tsx
Normal file
106
src/router/tools.tsx
Normal file
@@ -0,0 +1,106 @@
|
||||
import React from 'react'
|
||||
|
||||
const toolsJsonObjects: ToolsJsonObject[] = [
|
||||
{
|
||||
path: '',
|
||||
id: 'tools',
|
||||
component: React.lazy(() => import('@/pages/tools')),
|
||||
name: '主页',
|
||||
icon: React.lazy(() => import('~icons/fatweb/logo.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'all',
|
||||
id: 'tools-all',
|
||||
component: React.lazy(() => import('@/pages/tools')),
|
||||
name: '全部工具',
|
||||
icon: React.lazy(() => import('~icons/fatweb/logo.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: 'translation',
|
||||
id: 'tools-translation',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false,
|
||||
children: [
|
||||
{
|
||||
path: '1',
|
||||
id: '1',
|
||||
name: '翻译1',
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: '2',
|
||||
id: '2',
|
||||
name: '翻译2',
|
||||
menu: true,
|
||||
auth: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'translation-',
|
||||
id: 'tools-translation-',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译-',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false,
|
||||
children: [
|
||||
{
|
||||
path: '1-',
|
||||
id: '1-',
|
||||
name: '翻译1-',
|
||||
menu: true,
|
||||
auth: false
|
||||
},
|
||||
{
|
||||
path: '2-',
|
||||
id: '2-',
|
||||
name: '翻译2-',
|
||||
menu: true,
|
||||
auth: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'translation--',
|
||||
id: 'tools-translation--',
|
||||
component: React.lazy(() => import('@/pages/tools/Translation')),
|
||||
name: '翻译--',
|
||||
icon: React.lazy(() => import('~icons/fatweb/jenkins.jsx')),
|
||||
menu: true,
|
||||
auth: false
|
||||
}
|
||||
]
|
||||
|
||||
const tools: RouteObject[] = toolsJsonObjects.map((value) => ({
|
||||
path: value.path,
|
||||
id: value.id,
|
||||
Component: value.component,
|
||||
handle: {
|
||||
name: value.name,
|
||||
icon: value.icon,
|
||||
menu: value.menu,
|
||||
auth: value.auth
|
||||
},
|
||||
children: value.children?.map((value) => ({
|
||||
path: value.path,
|
||||
id: value.id,
|
||||
Component: value.component,
|
||||
handle: {
|
||||
name: value.name,
|
||||
icon: value.icon,
|
||||
menu: value.menu,
|
||||
auth: value.auth
|
||||
}
|
||||
}))
|
||||
}))
|
||||
|
||||
export default tools
|
||||
Reference in New Issue
Block a user