mod: 调整菜单图标和dashboard路由结构
This commit is contained in:
parent
2f592f9570
commit
28f0815211
@ -27,7 +27,7 @@ function resolvePath(basePath, path) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderIcon(icon, props = { size: 8 }) {
|
function renderIcon(icon, props = { size: 12 }) {
|
||||||
return () => h(NIcon, { ...props }, { default: () => h(icon) })
|
return () => h(NIcon, { ...props }, { default: () => h(icon) })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ function generateOptions(routes, basePath) {
|
|||||||
curOption.icon = renderIcon(route.meta?.icon || ListAlt, { size: 16 })
|
curOption.icon = renderIcon(route.meta?.icon || ListAlt, { size: 16 })
|
||||||
curOption.children = generateOptions(route.children, resolvePath(basePath, route.path))
|
curOption.children = generateOptions(route.children, resolvePath(basePath, route.path))
|
||||||
} else {
|
} else {
|
||||||
curOption.icon = renderIcon(route.meta?.icon || CircleRegular)
|
curOption.icon = (route.meta?.icon && renderIcon(route.meta?.icon)) || renderIcon(CircleRegular, { size: 8 })
|
||||||
}
|
}
|
||||||
options.push(curOption)
|
options.push(curOption)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Layout from '@/layout/index.vue'
|
import Layout from '@/layout/index.vue'
|
||||||
import Dashboard from '@/views/dashboard/index.vue'
|
import Home from '@/views/dashboard/index.vue'
|
||||||
import { Dove, Github, HouseDamage, Link } from '@vicons/fa'
|
import { ChartBar, Dove, Github, HouseDamage, Link, TimesCircle } from '@vicons/fa'
|
||||||
|
|
||||||
export const basicRoutes = [
|
export const basicRoutes = [
|
||||||
{
|
{
|
||||||
@ -33,21 +33,22 @@ export const basicRoutes = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'HOME',
|
name: 'DASHBOARD',
|
||||||
path: '/',
|
path: '/',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/dashboard',
|
redirect: '/home',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页',
|
title: 'Dashboard',
|
||||||
icon: HouseDamage,
|
icon: ChartBar,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'DASHBOARD',
|
name: 'HOME',
|
||||||
path: 'dashboard',
|
path: 'home',
|
||||||
component: Dashboard,
|
component: Home,
|
||||||
meta: {
|
meta: {
|
||||||
title: 'Dashboard',
|
title: '首页',
|
||||||
|
icon: HouseDamage,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -105,6 +106,7 @@ export const basicRoutes = [
|
|||||||
redirect: '/error-page/404',
|
redirect: '/error-page/404',
|
||||||
meta: {
|
meta: {
|
||||||
title: '错误页',
|
title: '错误页',
|
||||||
|
icon: TimesCircle,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user