100 lines
2.5 KiB
TypeScript
100 lines
2.5 KiB
TypeScript
import { RouteRecordRaw } from 'vue-router';
|
|
import { Layout } from '@/router/constant';
|
|
import { OptionsSharp } from '@vicons/ionicons5';
|
|
import { renderIcon } from '@/utils/index';
|
|
import { NBadge } from 'naive-ui';
|
|
import { h } from 'vue';
|
|
|
|
/**
|
|
* @param name 路由名称, 必须设置,且不能重名
|
|
* @param meta 路由元信息(路由附带扩展信息)
|
|
* @param redirect 重定向地址, 访问这个路由时,自定进行重定向
|
|
* @param meta.disabled 禁用整个菜单
|
|
* @param meta.title 菜单名称
|
|
* @param meta.icon 菜单图标
|
|
* @param meta.keepAlive 缓存该路由
|
|
* @param meta.sort 排序越小越排前
|
|
*
|
|
* */
|
|
const routes: Array<RouteRecordRaw> = [
|
|
{
|
|
path: '/system',
|
|
name: 'System',
|
|
redirect: '/system/menu',
|
|
component: Layout,
|
|
meta: {
|
|
documentTitle: '系统管理',
|
|
title: () => [
|
|
h('span', {}, '系统管理'),
|
|
h(NBadge, {
|
|
dot: true,
|
|
type: 'error',
|
|
value: 1,
|
|
style: {
|
|
marginLeft: '5px',
|
|
},
|
|
color: '#ff3b30',
|
|
}),
|
|
],
|
|
icon: renderIcon(OptionsSharp),
|
|
sort: 1,
|
|
},
|
|
children: [
|
|
{
|
|
path: 'user',
|
|
name: 'system_user',
|
|
meta: {
|
|
title: '用户管理',
|
|
},
|
|
component: () => import('@/views/system/user/user.vue'),
|
|
},
|
|
{
|
|
path: 'menu',
|
|
name: 'system_menu',
|
|
meta: {
|
|
title: '菜单管理',
|
|
},
|
|
component: () => import('@/views/system/menu/index.vue'),
|
|
},
|
|
{
|
|
path: 'menu/table',
|
|
name: 'system_menu_table',
|
|
meta: {
|
|
documentTitle: '菜单管理2',
|
|
title: () => [
|
|
h('span', {}, '菜单管理2'),
|
|
h(NBadge, {
|
|
dot: true,
|
|
type: 'error',
|
|
value: 1,
|
|
style: {
|
|
marginLeft: '5px',
|
|
},
|
|
color: '#ff3b30',
|
|
}),
|
|
],
|
|
},
|
|
component: () => import('@/views/system/menu/table.vue'),
|
|
},
|
|
{
|
|
path: 'role',
|
|
name: 'system_role',
|
|
meta: {
|
|
title: '角色管理',
|
|
},
|
|
component: () => import('@/views/system/role/role.vue'),
|
|
},
|
|
{
|
|
path: 'dictionary',
|
|
name: 'system_dictionary',
|
|
meta: {
|
|
title: '字典管理',
|
|
},
|
|
component: () => import('@/views/system/dictionary/dictionary.vue'),
|
|
},
|
|
],
|
|
},
|
|
];
|
|
|
|
export default routes;
|