Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qahome-diamond
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
qahome-diamond
Commits
64f83ad0
Commit
64f83ad0
authored
Mar 13, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释实例路由
parent
a37da656
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
131 additions
and
129 deletions
+131
-129
index.js
src/router/index.js
+131
-129
No files found.
src/router/index.js
View file @
64f83ad0
...
...
@@ -7,11 +7,11 @@ Vue.use(Router)
import
Layout
from
'
@/views/layout/Layout
'
/* Router Modules */
import
componentsRouter
from
'
./modules/components
'
import
chartsRouter
from
'
./modules/charts
'
// import componentsRouter from './modules/components'
// import chartsRouter from './modules/charts'
// import tableRouter from './modules/table'
// import nestedRouter from './modules/nested'
import
dockersRouter
from
'
./modules/docker
'
import
tableRouter
from
'
./modules/table
'
import
nestedRouter
from
'
./modules/nested
'
/** 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
...
...
@@ -90,33 +90,33 @@ export const constantRouterMap = [
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
({
...
...
@@ -126,6 +126,7 @@ export default new Router({
})
export
const
asyncRouterMap
=
[
dockersRouter
,
{
path
:
'
/dbsync
'
,
component
:
Layout
,
...
...
@@ -153,30 +154,31 @@ export const asyncRouterMap = [
}
]
},
{
path
:
'
/
statistics
'
,
path
:
'
/
proconfig
'
,
component
:
Layout
,
redirect
:
'
noredirect
'
,
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'
@/views/
statistics
/index
'
),
name
:
'
statistics
'
,
meta
:
{
title
:
'
用户行为记录
'
,
icon
:
'
peoples
'
}
component
:
()
=>
import
(
'
@/views/
proconfig
/index
'
),
name
:
'
proconfig
'
,
meta
:
{
title
:
'
项目配置文件管理
'
,
icon
:
'
documentation
'
}
}
]
},
{
path
:
'
/
proconfig
'
,
path
:
'
/
statistics
'
,
component
:
Layout
,
redirect
:
'
noredirect
'
,
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'
@/views/
proconfig
/index
'
),
name
:
'
proconfig
'
,
meta
:
{
title
:
'
项目配置文件管理
'
,
icon
:
'
documentation
'
}
component
:
()
=>
import
(
'
@/views/
statistics
/index
'
),
name
:
'
statistics
'
,
meta
:
{
title
:
'
用户行为记录
'
,
icon
:
'
peoples
'
}
}
]
},
...
...
@@ -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
'
,
component
:
Layout
,
children
:
[
{
path
:
'
index
'
,
component
:
()
=>
import
(
'
@/views/svg-icons/index
'
),
name
:
'
Icons
'
,
meta
:
{
title
:
'
icons
'
,
icon
:
'
icon
'
,
noCache
:
true
}
}
]
},
// {
// 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',
// 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**/
componentsRouter
,
chartsRouter
,
nestedRouter
,
tableRouter
,
dockersRouter
,
// componentsRouter,
// chartsRouter,
// nestedRouter,
// tableRouter,
{
path
:
'
/example
'
,
component
:
Layout
,
redirect
:
'
/example/list
'
,
name
:
'
Example
'
,
meta
:
{
title
:
'
example
'
,
icon
:
'
example
'
},
children
:
[
{
path
:
'
create
'
,
component
:
()
=>
import
(
'
@/views/example/create
'
),
name
:
'
CreateArticle
'
,
meta
:
{
title
:
'
createArticle
'
,
icon
:
'
edit
'
}
},
{
path
:
'
edit/:id(
\\
d+)
'
,
component
:
()
=>
import
(
'
@/views/example/edit
'
),
name
:
'
EditArticle
'
,
meta
:
{
title
:
'
editArticle
'
,
noCache
:
true
},
hidden
:
true
},
{
path
:
'
list
'
,
component
:
()
=>
import
(
'
@/views/example/list
'
),
name
:
'
ArticleList
'
,
meta
:
{
title
:
'
articleList
'
,
icon
:
'
list
'
}
}
]
},
//
{
//
path: '/example',
//
component: Layout,
//
redirect: '/example/list',
//
name: 'Example',
//
meta: {
//
title: 'example',
//
icon: 'example'
//
},
//
children: [
//
{
//
path: 'create',
//
component: () => import('@/views/example/create'),
//
name: 'CreateArticle',
//
meta: { title: 'createArticle', icon: 'edit' }
//
},
//
{
//
path: 'edit/:id(\\d+)',
//
component: () => import('@/views/example/edit'),
//
name: 'EditArticle',
//
meta: { title: 'editArticle', noCache: true },
//
hidden: true
//
},
//
{
//
path: 'list',
//
component: () => import('@/views/example/list'),
//
name: 'ArticleList',
//
meta: { title: 'articleList', icon: 'list' }
//
}
//
]
//
},
{
path
:
'
/tab
'
,
component
:
Layout
,
children
:
[
{
path
:
'
index
'
,
component
:
()
=>
import
(
'
@/views/tab/index
'
),
name
:
'
Tab
'
,
meta
:
{
title
:
'
tab
'
,
icon
:
'
tab
'
}
}
]
},
//
{
//
path: '/tab',
//
component: Layout,
//
children: [
//
{
//
path: 'index',
//
component: () => import('@/views/tab/index'),
//
name: 'Tab',
//
meta: { title: 'tab', icon: 'tab' }
//
}
//
]
//
},
// {
// path: '/error',
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment