forked from ergonode/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
router.js
37 lines (32 loc) · 819 Bytes
/
router.js
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
/* eslint-disable import/no-extraneous-dependencies */
/*
* Copyright © Bold Brand Commerce Sp. z o.o. All rights reserved.
* See LICENSE for license details.
*/
import Vue from 'vue';
import Router from 'vue-router';
import {
extendRoutes,
scrollBehavior,
setLocalMiddlewares,
} from '~/.nuxt/routerHelper.modules';
Vue.use(Router);
export function createRouter() {
const router = new Router({
mode: 'history',
base: '/',
linkActiveClass: 'nuxt-link-active',
linkExactActiveClass: 'nuxt-link-exact-active',
scrollBehavior,
routes: extendRoutes(),
fallback: false,
});
router.beforeEach(
(to, from, next) => setLocalMiddlewares({
to,
from,
next,
}),
);
return router;
}