feat(vue-app): export router options (#6231)

This commit is contained in:
Ricardo Gobbo de Souza 2019-08-14 16:38:25 -03:00 committed by Pooya Parsa
parent 35ba65562f
commit 2ad6bf2a08

View File

@ -84,8 +84,7 @@ const _routes = recursiveRoutes(router.routes, ' ', _components, 2)
Vue.use(Router)
export function createRouter() {
return new Router({
export const routerOptions = {
mode: '<%= router.mode %>',
base: decodeURI('<%= router.base %>'),
linkActiveClass: '<%= router.linkActiveClass %>',
@ -97,5 +96,8 @@ export function createRouter() {
<% if (router.parseQuery) { %>parseQuery: <%= serializeFunction(router.parseQuery) %>,<% } %>
<% if (router.stringifyQuery) { %>stringifyQuery: <%= serializeFunction(router.stringifyQuery) %>,<% } %>
fallback: <%= router.fallback %>
})
}
export function createRouter() {
return new Router(routerOptions)
}