20 lines
388 B
JavaScript
20 lines
388 B
JavaScript
import Vue from "vue";
|
|
import VueRouter from "vue-router";
|
|
import routes from "./routes";
|
|
Vue.use(VueRouter);
|
|
|
|
// configure router
|
|
const router = new VueRouter({
|
|
routes, // short for routes: routes
|
|
linkActiveClass: "active",
|
|
scrollBehavior: (to) => {
|
|
if (to.hash) {
|
|
return {selector: to.hash}
|
|
} else {
|
|
return { x: 0, y: 0 }
|
|
}
|
|
}
|
|
});
|
|
|
|
export default router;
|