forked from easy-mock/easy-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
router-config.js
46 lines (42 loc) · 1.39 KB
/
router-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import Vue from 'vue'
import Router from 'vue-router'
import docs from 'pages/docs'
import login from 'pages/login'
import group from 'pages/group'
import editor from 'pages/editor'
import project from 'pages/project'
import profile from 'pages/profile'
import createProject from 'pages/new'
import logOut from 'components/log-out'
import dashboard from 'pages/dashboard'
import detail from 'pages/project-detail'
import layout from 'components/layout/index'
Vue.use(Router)
export function createRouter () {
const router = new Router({
mode: 'history',
routes: [
{ path: '/login', component: login },
{ path: '/log-out', component: logOut },
{
path: '/',
component: layout,
children: [
{ path: '/', component: project },
{ path: 'workbench', component: project },
{ path: 'group/:id', component: project },
{ path: 'group', component: group },
{ path: 'docs', component: docs },
{ path: 'changelog', component: docs },
{ path: 'dashboard', component: dashboard },
{ path: 'profile', component: profile },
{ path: 'new', component: createProject },
{ path: 'project/:id', component: detail },
{ path: 'editor/:projectId', component: editor },
{ path: 'editor/:projectId/:id', component: editor }
]
}
]
})
return router
}