index.js
1.22 KB
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
import Vue from 'vue'
import Router from 'vue-router'
import { authGuard } from "../auth/authGuard"
import LandingPage from '@/components/LandingPage'
import SignUp from '@/components/SignUp'
import Reset from '@/components/Reset'
import Profile from '@/components/Profile'
import welcome from '@/components/welcome'
import router from '../router'
Vue.use(Router)
export default new Router({
mode: 'history',
routes: [{
path: '/',
name: 'LandingPage',
component: LandingPage,
beforeEnter: function(to, from, next) {
var userdata = localStorage.getItem('gigs_usertoken')
if (userdata) {
router.push({ name: 'Welcome' })
}
next()
}
},
{
path: '/signup',
name: 'SignUp',
component: SignUp,
},
{
path: '/reset',
name: 'Reset',
component: Reset,
},
{
path: '/profile',
name: 'Profile',
component: Profile,
}
],
scrollBehavior(to, from, savedPosition) {
this.seen = false
return { x: 0, y: 0 }
}
})