Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5e91104

Browse filesBrowse files
committed
完成全应用的路由设置
1 parent 52ed986 commit 5e91104
Copy full SHA for 5e91104

File tree

1 file changed

+76
-6
lines changed
Filter options

1 file changed

+76
-6
lines changed

‎src/router/index.js

Copy file name to clipboard
+76-6Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,85 @@
11
import Vue from 'vue'
22
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'
512
Vue.use(Router)
613

714
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: [{
1036
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
1370
}
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+
1484
]
1585
})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.