mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
33 lines
656 B
JavaScript
33 lines
656 B
JavaScript
import Vue from 'vue'
|
|
import VueRouter from 'vue-router'
|
|
import routes from './routes'
|
|
import CONFIG from '../config'
|
|
|
|
Vue.use(VueRouter)
|
|
|
|
// configure router
|
|
const router = new VueRouter({
|
|
base: '/vue',
|
|
routes, // short for routes: routes
|
|
linkActiveClass: 'active',
|
|
mode: 'history',
|
|
scrollBehavior: (to, from, savedPosition) => {
|
|
if (savedPosition) {
|
|
return savedPosition
|
|
}
|
|
if (to.hash) {
|
|
return { selector: to.hash }
|
|
}
|
|
return { x: 0, y: 0 }
|
|
},
|
|
})
|
|
|
|
if (CONFIG.ALLOW_REGISTER) {
|
|
router.addRoute({
|
|
path: '/register',
|
|
component: () => import('../views/Pages/Register.vue'),
|
|
})
|
|
}
|
|
|
|
export default router
|