Commit 64f83ad0 authored by 智勇's avatar 智勇

注释实例路由

parent a37da656
...@@ -7,11 +7,11 @@ Vue.use(Router) ...@@ -7,11 +7,11 @@ Vue.use(Router)
import Layout from '@/views/layout/Layout' import Layout from '@/views/layout/Layout'
/* Router Modules */ /* Router Modules */
import componentsRouter from './modules/components' // import componentsRouter from './modules/components'
import chartsRouter from './modules/charts' // import chartsRouter from './modules/charts'
// import tableRouter from './modules/table'
// import nestedRouter from './modules/nested'
import dockersRouter from './modules/docker' import dockersRouter from './modules/docker'
import tableRouter from './modules/table'
import nestedRouter from './modules/nested'
/** note: sub-menu only appear when children.length>=1 /** note: sub-menu only appear when children.length>=1
* detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
...@@ -90,33 +90,33 @@ export const constantRouterMap = [ ...@@ -90,33 +90,33 @@ export const constantRouterMap = [
meta: { title: 'indexList', icon: 'link' } meta: { title: 'indexList', icon: 'link' }
} }
] ]
},
{
path: '/documentation',
component: Layout,
redirect: '/documentation/index',
children: [
{
path: 'index',
component: () => import('@/views/documentation/index'),
name: 'Documentation',
meta: { title: 'documentation', icon: 'documentation', affix: true }
}
]
},
{
path: '/guide',
component: Layout,
redirect: '/guide/index',
children: [
{
path: 'index',
component: () => import('@/views/guide/index'),
name: 'Guide',
meta: { title: 'guide', icon: 'guide', noCache: true }
}
]
} }
// {
// path: '/documentation',
// component: Layout,
// redirect: '/documentation/index',
// children: [
// {
// path: 'index',
// component: () => import('@/views/documentation/index'),
// name: 'Documentation',
// meta: { title: 'documentation', icon: 'documentation', affix: true }
// }
// ]
// },
// {
// path: '/guide',
// component: Layout,
// redirect: '/guide/index',
// children: [
// {
// path: 'index',
// component: () => import('@/views/guide/index'),
// name: 'Guide',
// meta: { title: 'guide', icon: 'guide', noCache: true }
// }
// ]
// }
] ]
export default new Router({ export default new Router({
...@@ -126,6 +126,7 @@ export default new Router({ ...@@ -126,6 +126,7 @@ export default new Router({
}) })
export const asyncRouterMap = [ export const asyncRouterMap = [
dockersRouter,
{ {
path: '/dbsync', path: '/dbsync',
component: Layout, component: Layout,
...@@ -153,30 +154,31 @@ export const asyncRouterMap = [ ...@@ -153,30 +154,31 @@ export const asyncRouterMap = [
} }
] ]
}, },
{ {
path: '/statistics', path: '/proconfig',
component: Layout, component: Layout,
redirect: 'noredirect', redirect: 'noredirect',
children: [ children: [
{ {
path: '', path: '',
component: () => import('@/views/statistics/index'), component: () => import('@/views/proconfig/index'),
name: 'statistics', name: 'proconfig',
meta: { title: '用户行为记录', icon: 'peoples' } meta: { title: '项目配置文件管理', icon: 'documentation' }
} }
] ]
}, },
{ {
path: '/proconfig', path: '/statistics',
component: Layout, component: Layout,
redirect: 'noredirect', redirect: 'noredirect',
children: [ children: [
{ {
path: '', path: '',
component: () => import('@/views/proconfig/index'), component: () => import('@/views/statistics/index'),
name: 'proconfig', name: 'statistics',
meta: { title: '项目配置文件管理', icon: 'documentation' } meta: { title: '用户行为记录', icon: 'peoples' }
} }
] ]
}, },
...@@ -219,102 +221,102 @@ export const asyncRouterMap = [ ...@@ -219,102 +221,102 @@ export const asyncRouterMap = [
} }
] ]
}, },
{
path: '/permission',
component: Layout,
redirect: '/permission/index',
alwaysShow: true, // will always show the root menu
meta: {
title: 'permission',
icon: 'lock',
roles: ['admin', 'editor'] // you can set roles in root nav
},
children: [
{
path: 'page',
component: () => import('@/views/permission/page'),
name: 'PagePermission',
meta: {
title: 'pagePermission',
roles: ['admin'] // or you can only set roles in sub nav
}
},
{
path: 'directive',
component: () => import('@/views/permission/directive'),
name: 'DirectivePermission',
meta: {
title: 'directivePermission'
// if do not set roles, means: this page does not require permission
}
}
]
},
{ // {
path: '/icon', // path: '/permission',
component: Layout, // component: Layout,
children: [ // redirect: '/permission/index',
{ // alwaysShow: true, // will always show the root menu
path: 'index', // meta: {
component: () => import('@/views/svg-icons/index'), // title: 'permission',
name: 'Icons', // icon: 'lock',
meta: { title: 'icons', icon: 'icon', noCache: true } // roles: ['admin', 'editor'] // you can set roles in root nav
} // },
] // children: [
}, // {
// path: 'page',
// component: () => import('@/views/permission/page'),
// name: 'PagePermission',
// meta: {
// title: 'pagePermission',
// roles: ['admin'] // or you can only set roles in sub nav
// }
// },
// {
// path: 'directive',
// component: () => import('@/views/permission/directive'),
// name: 'DirectivePermission',
// meta: {
// title: 'directivePermission'
// // if do not set roles, means: this page does not require permission
// }
// }
// ]
// },
// {
// path: '/icon',
// component: Layout,
// children: [
// {
// path: 'index',
// component: () => import('@/views/svg-icons/index'),
// name: 'Icons',
// meta: { title: 'icons', icon: 'icon', noCache: true }
// }
// ]
// },
/** When your routing table is too long, you can split it into small modules**/ /** When your routing table is too long, you can split it into small modules**/
componentsRouter, // componentsRouter,
chartsRouter, // chartsRouter,
nestedRouter, // nestedRouter,
tableRouter, // tableRouter,
dockersRouter,
{ // {
path: '/example', // path: '/example',
component: Layout, // component: Layout,
redirect: '/example/list', // redirect: '/example/list',
name: 'Example', // name: 'Example',
meta: { // meta: {
title: 'example', // title: 'example',
icon: 'example' // icon: 'example'
}, // },
children: [ // children: [
{ // {
path: 'create', // path: 'create',
component: () => import('@/views/example/create'), // component: () => import('@/views/example/create'),
name: 'CreateArticle', // name: 'CreateArticle',
meta: { title: 'createArticle', icon: 'edit' } // meta: { title: 'createArticle', icon: 'edit' }
}, // },
{ // {
path: 'edit/:id(\\d+)', // path: 'edit/:id(\\d+)',
component: () => import('@/views/example/edit'), // component: () => import('@/views/example/edit'),
name: 'EditArticle', // name: 'EditArticle',
meta: { title: 'editArticle', noCache: true }, // meta: { title: 'editArticle', noCache: true },
hidden: true // hidden: true
}, // },
{ // {
path: 'list', // path: 'list',
component: () => import('@/views/example/list'), // component: () => import('@/views/example/list'),
name: 'ArticleList', // name: 'ArticleList',
meta: { title: 'articleList', icon: 'list' } // meta: { title: 'articleList', icon: 'list' }
} // }
] // ]
}, // },
{ // {
path: '/tab', // path: '/tab',
component: Layout, // component: Layout,
children: [ // children: [
{ // {
path: 'index', // path: 'index',
component: () => import('@/views/tab/index'), // component: () => import('@/views/tab/index'),
name: 'Tab', // name: 'Tab',
meta: { title: 'tab', icon: 'tab' } // meta: { title: 'tab', icon: 'tab' }
} // }
] // ]
}, // },
// { // {
// path: '/error', // path: '/error',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment