Merge pull request #2100 from clarkdo/route_parseQuery

feat: add parseQuery and stringifyQuery for router
This commit is contained in:
Sébastien Chopin 2017-11-14 10:38:44 +01:00 committed by GitHub
commit de2b0a6d56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,8 @@ export function createRouter () {
routes: [ routes: [
<%= _routes %> <%= _routes %>
], ],
<% if (router.parseQuery) { %>parseQuery: <%= serialize(router.parseQuery).replace('parseQuery(', 'function(') %>,<% } %>
<% if (router.stringifyQuery) { %>stringifyQuery: <%= serialize(router.stringifyQuery).replace('stringifyQuery(', 'function(') %>,<% } %>
fallback: <%= router.fallback %> fallback: <%= router.fallback %>
}) })
} }

View File

@ -274,6 +274,8 @@ Options.defaults = {
linkExactActiveClass: 'nuxt-link-exact-active', linkExactActiveClass: 'nuxt-link-exact-active',
extendRoutes: null, extendRoutes: null,
scrollBehavior: null, scrollBehavior: null,
parseQuery: false,
stringifyQuery: false,
fallback: false fallback: false
}, },
render: { render: {