64 lines
1.8 KiB
JavaScript
64 lines
1.8 KiB
JavaScript
import Vue from 'vue'
|
|
import Router from 'vue-router'
|
|
import { normalizeURL, decode } from 'ufo'
|
|
import { interopDefault } from './utils'
|
|
import scrollBehavior from './router.scrollBehavior.js'
|
|
|
|
const _47a018a8 = () => interopDefault(import('../pages/signin.vue' /* webpackChunkName: "pages/signin" */))
|
|
const _4d08ae70 = () => interopDefault(import('../pages/welcome.vue' /* webpackChunkName: "pages/welcome" */))
|
|
const _53d24441 = () => interopDefault(import('../pages/account/recovery.vue' /* webpackChunkName: "pages/account/recovery" */))
|
|
const _1d58cc90 = () => interopDefault(import('../pages/index.vue' /* webpackChunkName: "pages/index" */))
|
|
|
|
const emptyFn = () => {}
|
|
|
|
Vue.use(Router)
|
|
|
|
export const routerOptions = {
|
|
mode: 'history',
|
|
base: '/',
|
|
linkActiveClass: 'nuxt-link-active',
|
|
linkExactActiveClass: 'nuxt-link-exact-active',
|
|
scrollBehavior,
|
|
|
|
routes: [{
|
|
path: "/signin",
|
|
component: _47a018a8,
|
|
name: "signin"
|
|
}, {
|
|
path: "/welcome",
|
|
component: _4d08ae70,
|
|
name: "welcome"
|
|
}, {
|
|
path: "/account/recovery",
|
|
component: _53d24441,
|
|
name: "account-recovery"
|
|
}, {
|
|
path: "/",
|
|
component: _1d58cc90,
|
|
name: "index"
|
|
}],
|
|
|
|
fallback: false
|
|
}
|
|
|
|
export function createRouter (ssrContext, config) {
|
|
const base = (config._app && config._app.basePath) || routerOptions.base
|
|
const router = new Router({ ...routerOptions, base })
|
|
|
|
// TODO: remove in Nuxt 3
|
|
const originalPush = router.push
|
|
router.push = function push (location, onComplete = emptyFn, onAbort) {
|
|
return originalPush.call(this, location, onComplete, onAbort)
|
|
}
|
|
|
|
const resolve = router.resolve.bind(router)
|
|
router.resolve = (to, current, append) => {
|
|
if (typeof to === 'string') {
|
|
to = normalizeURL(to)
|
|
}
|
|
return resolve(to, current, append)
|
|
}
|
|
|
|
return router
|
|
}
|