mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
feat(vue-app): export router options (#6231)
This commit is contained in:
parent
35ba65562f
commit
2ad6bf2a08
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user