index.js
798 Bytes
import Vue from 'vue'
import Router from 'vue-router'
import { authGuard } from "../auth/authGuard"
import LandingPage from '@/components/LandingPage'
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()
}
},
],
scrollBehavior(to, from, savedPosition) {
this.seen = false
return { x: 0, y: 0 }
}
})