提交 | 用户 | age
|
3ac5f2
|
1 |
/** |
J |
2 |
* router 配置,使用路由懒加载 |
|
3 |
*/ |
|
4 |
import Vue from 'vue' |
|
5 |
import Router from 'vue-router' |
|
6 |
import Store from '../store' |
|
7 |
// import HelloWorld from '@/components/HelloWorld' |
|
8 |
|
|
9 |
Vue.use(Router) |
|
10 |
|
|
11 |
let router = new Router({ |
|
12 |
// mode: 'history', |
|
13 |
routes: [ |
|
14 |
{ |
|
15 |
path: '/', |
|
16 |
name: 'root', |
bb2b08
|
17 |
// component: () => import('@/pages/index') |
aeb317
|
18 |
component: () => import('@/pages/login/index') |
J |
19 |
// component: () => import('@/pages/room/list') |
|
20 |
}, |
|
21 |
{ |
|
22 |
path: '/login', |
|
23 |
name: 'login', |
|
24 |
component: () => import('@/pages/login/index') |
3ac5f2
|
25 |
}, |
J |
26 |
{ |
|
27 |
path: '/index', |
|
28 |
name: 'index', |
|
29 |
component: () => import('@/pages/index') |
|
30 |
}, |
|
31 |
{ |
|
32 |
path: '/room/list', |
|
33 |
name: 'roomList', |
|
34 |
component: () => import('@/pages/room/list') |
|
35 |
}, |
|
36 |
{ |
|
37 |
path: '/room/detail', |
|
38 |
name: 'roomDetail', |
|
39 |
component: () => import('@/pages/room/detail') |
|
40 |
} |
|
41 |
] |
|
42 |
}) |
|
43 |
|
|
44 |
export default router |