-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.js
78 lines (70 loc) · 1.82 KB
/
router.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import Vue from 'vue'
import Router from 'vue-router'
import { scrollBehavior } from '~/utilities'
Vue.use(Router)
const page = path => () => import(`~/pages/${path}`).then(m => m.default || m)
const routes = [
{ path: "/", name: "home", component: page("home.vue") },
{ path: "/dev/atoms", name: "atoms", component: page("dev/atoms.vue") },
{ path: "/signin", name: "signin", component: page("auth/signin.vue") },
{ path: "/signup", name: "signup", component: page("auth/signup.vue") },
{
path: "/password/reset",
name: "password.request",
component: page("auth/password/email.vue")
},
{
path: "/password/reset/:token",
name: "password.reset",
component: page("auth/password/reset.vue")
},
{
path: "/email/verify/:id",
name: "verification.verify",
component: page("auth/verification/verify.vue")
},
{
path: "/email/resend",
name: "verification.resend",
component: page("auth/verification/resend.vue")
},
{
path: "/me/dashboard",
name: "dashboard",
component: page("me/settings.vue")
},
{
path: "/settings",
component: page("settings/index.vue"),
children: [
{ path: "", redirect: { name: "settings.profile" } },
{
path: "profile",
name: "settings.profile",
component: page("settings/profile.vue")
},
{
path: "password",
name: "settings.password",
component: page("settings/password.vue")
},
{
path: "addresses",
name: "settings.addresses",
component: page("settings/addresses.vue")
},
{
path: "payments",
name: "settings.payments",
component: page("settings/payments.vue")
}
]
}
];
export function createRouter() {
return new Router({
routes,
scrollBehavior,
mode: 'history'
})
}