|
1 | 1 | import Vue from 'vue'
|
2 | 2 | import Router from 'vue-router'
|
3 |
| -import Hello from '@/components/Hello' |
4 |
| - |
| 3 | +import HomePage from '@/pages/homePage' |
| 4 | +import Issues from '@/pages/issues' |
| 5 | +import IssuesDetail from '@/pages/issuesDetail' |
| 6 | +import Products from '@/pages/products' |
| 7 | +import ProductsHome from '@/pages/productsHome' |
| 8 | +import GoodsCart from '@/pages/goodsCart' |
| 9 | +import Login from '@/pages/login' |
| 10 | +import ProductsDetailInfo from '@/pages/productsDetailInfo' |
| 11 | +import ProductsPreview from '@/pages/productsPreview' |
5 | 12 | Vue.use(Router)
|
6 | 13 |
|
7 | 14 | export default new Router({
|
8 |
| - routes: [ |
9 |
| - { |
| 15 | + mode: 'history', |
| 16 | + routes: [{ |
| 17 | + path: '/', |
| 18 | + name: 'HomePage', |
| 19 | + component: HomePage |
| 20 | + }, |
| 21 | + { |
| 22 | + path: '/issues', |
| 23 | + name: 'Issues', |
| 24 | + component: Issues |
| 25 | + }, |
| 26 | + { |
| 27 | + path: '/issues/:issuesNum', |
| 28 | + component: IssuesDetail |
| 29 | + }, |
| 30 | + { |
| 31 | + path: '/products', |
| 32 | + // name: 'Products', |
| 33 | + component: Products, |
| 34 | + // redirect: '/products', |
| 35 | + children: [{ |
10 | 36 | path: '/',
|
11 |
| - name: 'Hello', |
12 |
| - component: Hello |
| 37 | + component: ProductsHome |
| 38 | + }, |
| 39 | + { |
| 40 | + path: 'swifter-tips', |
| 41 | + component: ProductsDetailInfo |
| 42 | + }, |
| 43 | + { |
| 44 | + path: 'functional-swift', |
| 45 | + component: ProductsDetailInfo |
| 46 | + }, |
| 47 | + { |
| 48 | + path: 'core-data', |
| 49 | + component: ProductsDetailInfo |
| 50 | + }, |
| 51 | + { |
| 52 | + path: 'advanced-swift', |
| 53 | + component: ProductsDetailInfo |
| 54 | + }, |
| 55 | + { |
| 56 | + path: 'swifter-tips/preview', |
| 57 | + component: ProductsPreview |
| 58 | + }, |
| 59 | + { |
| 60 | + path: 'functional-swift/preview', |
| 61 | + component: ProductsPreview |
| 62 | + }, |
| 63 | + { |
| 64 | + path: 'core-data/preview', |
| 65 | + component: ProductsPreview |
| 66 | + }, |
| 67 | + { |
| 68 | + path: 'advanced-swift/preview', |
| 69 | + component: ProductsPreview |
13 | 70 | }
|
| 71 | + ] |
| 72 | + }, |
| 73 | + { |
| 74 | + path: '/goodscart', |
| 75 | + name: 'GoodsCart', |
| 76 | + component: GoodsCart |
| 77 | + }, |
| 78 | + { |
| 79 | + path: '/login', |
| 80 | + name: 'Login', |
| 81 | + component: Login |
| 82 | + } |
| 83 | + |
14 | 84 | ]
|
15 | 85 | })
|
0 commit comments