86 lines
1.7 KiB
JavaScript
86 lines
1.7 KiB
JavaScript
// 静态路由配置
|
||
// 书写格式与动态路由格式一致,全部经由框架统一转换
|
||
// 比较动态路由在meta中多加入了role角色权限,为数组类型。一个菜单是否有权限显示,取决于它以及后代菜单是否有权限。
|
||
// routes 显示在左侧菜单中的路由(显示顺序在动态路由之前)
|
||
// 示例如下
|
||
|
||
// const routes = [
|
||
// {
|
||
// name: "demo",
|
||
// path: "/demo",
|
||
// meta: {
|
||
// icon: "el-icon-eleme-filled",
|
||
// title: "演示",
|
||
// role: ["SA"]
|
||
// },
|
||
// children: [{
|
||
// name: "demopage",
|
||
// path: "/demopage",
|
||
// component: "test/autocode/index",
|
||
// meta: {
|
||
// icon: "el-icon-menu",
|
||
// title: "演示页面",
|
||
// role: ["SA"]
|
||
// }
|
||
// }]
|
||
// }
|
||
// ]
|
||
|
||
const routes = [
|
||
{
|
||
"name": "home",
|
||
"path": "/home",
|
||
"meta": {
|
||
"title": "首页",
|
||
"icon": "el-icon-home-filled",
|
||
"type": "menu"
|
||
},
|
||
"component": "home"
|
||
},
|
||
{
|
||
"name": "nat",
|
||
"path": "/network/nat",
|
||
"meta": {
|
||
"title": "端口转发",
|
||
"icon": "el-icon-sort",
|
||
"type": "menu"
|
||
},
|
||
"component": "network/nat"
|
||
},
|
||
{
|
||
"name": "statistics",
|
||
"path": "/statistics",
|
||
"meta": {
|
||
"title": "统计报表",
|
||
"icon": "el-icon-data-analysis",
|
||
"type": "menu"
|
||
},
|
||
children:[
|
||
{
|
||
"path": "/statistics/device-traffic",
|
||
"name": "deviceTraffic",
|
||
"meta": {
|
||
"title": "设备流量",
|
||
"icon": "el-icon-iphone",
|
||
"type": "menu"
|
||
},
|
||
"component": "statistics/deviceTraffic"
|
||
},
|
||
],
|
||
"component": "network/nat"
|
||
}
|
||
,
|
||
{
|
||
"path": "/other/about",
|
||
"name": "about",
|
||
"meta": {
|
||
"title": "关于",
|
||
"icon": "el-icon-info-filled",
|
||
"type": "menu"
|
||
},
|
||
"component": "other/about"
|
||
}
|
||
]
|
||
|
||
export default routes;
|