mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-17 06:01:34 +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)
|
Vue.use(Router)
|
||||||
|
|
||||||
export function createRouter() {
|
export const routerOptions = {
|
||||||
return new Router({
|
|
||||||
mode: '<%= router.mode %>',
|
mode: '<%= router.mode %>',
|
||||||
base: decodeURI('<%= router.base %>'),
|
base: decodeURI('<%= router.base %>'),
|
||||||
linkActiveClass: '<%= router.linkActiveClass %>',
|
linkActiveClass: '<%= router.linkActiveClass %>',
|
||||||
@ -97,5 +96,8 @@ export function createRouter() {
|
|||||||
<% if (router.parseQuery) { %>parseQuery: <%= serializeFunction(router.parseQuery) %>,<% } %>
|
<% if (router.parseQuery) { %>parseQuery: <%= serializeFunction(router.parseQuery) %>,<% } %>
|
||||||
<% if (router.stringifyQuery) { %>stringifyQuery: <%= serializeFunction(router.stringifyQuery) %>,<% } %>
|
<% if (router.stringifyQuery) { %>stringifyQuery: <%= serializeFunction(router.stringifyQuery) %>,<% } %>
|
||||||
fallback: <%= router.fallback %>
|
fallback: <%= router.fallback %>
|
||||||
})
|
}
|
||||||
|
|
||||||
|
export function createRouter() {
|
||||||
|
return new Router(routerOptions)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user