|
@@ -30,8 +30,7 @@ import Layout from '@/layout'
|
|
|
* a base page that does not have permission requirements
|
|
|
* all roles can be accessed
|
|
|
*/
|
|
|
-export const constantRoutes = [
|
|
|
- {
|
|
|
+export const constantRoutes = [{
|
|
|
path: '/login',
|
|
|
component: () => import('@/views/login/index'),
|
|
|
hidden: true
|
|
@@ -51,7 +50,10 @@ export const constantRoutes = [
|
|
|
path: 'dashboard',
|
|
|
name: 'Dashboard',
|
|
|
component: () => import('@/views/dashboard/index'),
|
|
|
- meta: { title: 'Dashboard', icon: 'dashboard' }
|
|
|
+ meta: {
|
|
|
+ title: 'Dashboard',
|
|
|
+ icon: 'dashboard'
|
|
|
+ }
|
|
|
}]
|
|
|
},
|
|
|
|
|
@@ -60,19 +62,27 @@ export const constantRoutes = [
|
|
|
component: Layout,
|
|
|
redirect: '/example/table',
|
|
|
name: 'Example',
|
|
|
- meta: { title: 'Example', icon: 'el-icon-s-help' },
|
|
|
- children: [
|
|
|
- {
|
|
|
+ meta: {
|
|
|
+ title: 'Example',
|
|
|
+ icon: 'el-icon-s-help'
|
|
|
+ },
|
|
|
+ children: [{
|
|
|
path: 'table',
|
|
|
name: 'Table',
|
|
|
component: () => import('@/views/table/index'),
|
|
|
- meta: { title: 'Table', icon: 'table' }
|
|
|
+ meta: {
|
|
|
+ title: 'Table',
|
|
|
+ icon: 'table'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
path: 'tree',
|
|
|
name: 'Tree',
|
|
|
component: () => import('@/views/tree/index'),
|
|
|
- meta: { title: 'Tree', icon: 'tree' }
|
|
|
+ meta: {
|
|
|
+ title: 'Tree',
|
|
|
+ icon: 'tree'
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -80,52 +90,91 @@ export const constantRoutes = [
|
|
|
{
|
|
|
path: '/form',
|
|
|
component: Layout,
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: 'index',
|
|
|
- name: 'Form',
|
|
|
- component: () => import('@/views/form/index'),
|
|
|
- meta: { title: 'Form', icon: 'form' }
|
|
|
+ children: [{
|
|
|
+ path: 'index',
|
|
|
+ name: 'Form',
|
|
|
+ component: () => import('@/views/form/index'),
|
|
|
+ meta: {
|
|
|
+ title: 'Form',
|
|
|
+ icon: 'form'
|
|
|
}
|
|
|
- ]
|
|
|
+ }]
|
|
|
},
|
|
|
{
|
|
|
path: '/level',
|
|
|
component: Layout,
|
|
|
- meta: { title: 'Level', icon: 'level' },
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: 'levelList',
|
|
|
- name: 'levelList',
|
|
|
- component: () => import('@/views/level/levelList'),
|
|
|
- meta: { title: '等级列表', icon: 'level' }
|
|
|
- },{
|
|
|
- path: 'addLevel',
|
|
|
- name: 'addLevel',
|
|
|
- component: () => import('@/views/level/addLevel'),
|
|
|
- meta: { title: '添加等级', icon: 'level' }
|
|
|
+ meta: {
|
|
|
+ title: 'Level',
|
|
|
+ icon: 'level'
|
|
|
+ },
|
|
|
+ children: [{
|
|
|
+ path: 'levelList',
|
|
|
+ name: 'levelList',
|
|
|
+ component: () => import('@/views/level/levelList'),
|
|
|
+ meta: {
|
|
|
+ title: '等级列表',
|
|
|
+ icon: 'level'
|
|
|
}
|
|
|
- ]
|
|
|
+ }, {
|
|
|
+ path: 'addLevel',
|
|
|
+ name: 'addLevel',
|
|
|
+ component: () => import('@/views/level/addLevel'),
|
|
|
+ meta: {
|
|
|
+ title: '添加等级',
|
|
|
+ icon: 'level'
|
|
|
+ }
|
|
|
+ }]
|
|
|
},
|
|
|
{
|
|
|
path: '/location',
|
|
|
component: Layout,
|
|
|
- meta: { title: 'Location', icon: 'location' },
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: 'locationList',
|
|
|
- name: 'locationList',
|
|
|
- component: () => import('@/views/location/locationList'),
|
|
|
- meta: { title: '地址列表', icon: 'location' }
|
|
|
- },{
|
|
|
- path: 'addLocation',
|
|
|
- name: 'addLocation',
|
|
|
- component: () => import('@/views/location/addLocation'),
|
|
|
- meta: { title: '添加地址', icon: 'location' }
|
|
|
+ meta: {
|
|
|
+ title: 'Location',
|
|
|
+ icon: 'location'
|
|
|
+ },
|
|
|
+ children: [{
|
|
|
+ path: 'locationList',
|
|
|
+ name: 'locationList',
|
|
|
+ component: () => import('@/views/location/locationList'),
|
|
|
+ meta: {
|
|
|
+ title: '地址列表',
|
|
|
+ icon: 'location'
|
|
|
}
|
|
|
- ]
|
|
|
+ }, {
|
|
|
+ path: 'addLocation',
|
|
|
+ name: 'addLocation',
|
|
|
+ component: () => import('@/views/location/addLocation'),
|
|
|
+ meta: {
|
|
|
+ title: '添加地址',
|
|
|
+ icon: 'location'
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ path: '/message',
|
|
|
+ component: Layout,
|
|
|
+ meta: {
|
|
|
+ title: 'Message',
|
|
|
+ icon: 'message'
|
|
|
+ },
|
|
|
+ children: [{
|
|
|
+ path: 'messageList',
|
|
|
+ name: 'messageList',
|
|
|
+ component: () => import('@/views/message/messageList'),
|
|
|
+ meta: {
|
|
|
+ title: '地址列表',
|
|
|
+ icon: 'message'
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ path: 'addMessage',
|
|
|
+ name: 'addMessage',
|
|
|
+ component: () => import('@/views/message/addMessage'),
|
|
|
+ meta: {
|
|
|
+ title: '添加地址',
|
|
|
+ icon: 'message'
|
|
|
+ }
|
|
|
+ }]
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
path: '/nested',
|
|
|
component: Layout,
|
|
@@ -135,36 +184,43 @@ export const constantRoutes = [
|
|
|
title: 'Nested',
|
|
|
icon: 'nested'
|
|
|
},
|
|
|
- children: [
|
|
|
- {
|
|
|
+ children: [{
|
|
|
path: 'menu1',
|
|
|
component: () => import('@/views/nested/menu1/index'), // Parent router-view
|
|
|
name: 'Menu1',
|
|
|
- meta: { title: 'Menu1' },
|
|
|
- children: [
|
|
|
- {
|
|
|
+ meta: {
|
|
|
+ title: 'Menu1'
|
|
|
+ },
|
|
|
+ children: [{
|
|
|
path: 'menu1-1',
|
|
|
component: () => import('@/views/nested/menu1/menu1-1'),
|
|
|
name: 'Menu1-1',
|
|
|
- meta: { title: 'Menu1-1' }
|
|
|
+ meta: {
|
|
|
+ title: 'Menu1-1'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
path: 'menu1-2',
|
|
|
component: () => import('@/views/nested/menu1/menu1-2'),
|
|
|
name: 'Menu1-2',
|
|
|
- meta: { title: 'Menu1-2' },
|
|
|
- children: [
|
|
|
- {
|
|
|
+ meta: {
|
|
|
+ title: 'Menu1-2'
|
|
|
+ },
|
|
|
+ children: [{
|
|
|
path: 'menu1-2-1',
|
|
|
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'),
|
|
|
name: 'Menu1-2-1',
|
|
|
- meta: { title: 'Menu1-2-1' }
|
|
|
+ meta: {
|
|
|
+ title: 'Menu1-2-1'
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
path: 'menu1-2-2',
|
|
|
component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'),
|
|
|
name: 'Menu1-2-2',
|
|
|
- meta: { title: 'Menu1-2-2' }
|
|
|
+ meta: {
|
|
|
+ title: 'Menu1-2-2'
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -172,7 +228,9 @@ export const constantRoutes = [
|
|
|
path: 'menu1-3',
|
|
|
component: () => import('@/views/nested/menu1/menu1-3'),
|
|
|
name: 'Menu1-3',
|
|
|
- meta: { title: 'Menu1-3' }
|
|
|
+ meta: {
|
|
|
+ title: 'Menu1-3'
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -180,7 +238,9 @@ export const constantRoutes = [
|
|
|
path: 'menu2',
|
|
|
component: () => import('@/views/nested/menu2/index'),
|
|
|
name: 'Menu2',
|
|
|
- meta: { title: 'menu2' }
|
|
|
+ meta: {
|
|
|
+ title: 'menu2'
|
|
|
+ }
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -188,21 +248,28 @@ export const constantRoutes = [
|
|
|
{
|
|
|
path: 'external-link',
|
|
|
component: Layout,
|
|
|
- children: [
|
|
|
- {
|
|
|
- path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
|
|
|
- meta: { title: 'External Link', icon: 'link' }
|
|
|
+ children: [{
|
|
|
+ path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
|
|
|
+ meta: {
|
|
|
+ title: 'External Link',
|
|
|
+ icon: 'link'
|
|
|
}
|
|
|
- ]
|
|
|
+ }]
|
|
|
},
|
|
|
|
|
|
// 404 page must be placed at the end !!!
|
|
|
- { path: '*', redirect: '/404', hidden: true }
|
|
|
+ {
|
|
|
+ path: '*',
|
|
|
+ redirect: '/404',
|
|
|
+ hidden: true
|
|
|
+ }
|
|
|
]
|
|
|
|
|
|
const createRouter = () => new Router({
|
|
|
// mode: 'history', // require service support
|
|
|
- scrollBehavior: () => ({ y: 0 }),
|
|
|
+ scrollBehavior: () => ({
|
|
|
+ y: 0
|
|
|
+ }),
|
|
|
routes: constantRoutes
|
|
|
})
|
|
|
|