You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
523 B
JavaScript
31 lines
523 B
JavaScript
import Vue from 'vue'
|
|
import VueRouter from 'vue-router'
|
|
import Home from '../views/Home.vue'
|
|
|
|
Vue.use(VueRouter)
|
|
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
name: 'Home',
|
|
component: Home
|
|
}
|
|
]
|
|
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
base: process.env.BASE_URL,
|
|
routes,
|
|
scrollBehavior (to, from, savedPosition) {
|
|
if (to.hash) {
|
|
return { selector: to.hash }
|
|
} else if (savedPosition) {
|
|
return savedPosition
|
|
} else {
|
|
return { x: 0, y: 0 }
|
|
}
|
|
}
|
|
})
|
|
|
|
export default router
|