mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
chore(vue-app): use serializeFunction when appropriate (#4575)
This commit is contained in:
parent
afd1cd3247
commit
25d26ba42f
@ -49,7 +49,7 @@ const _routes = recursiveRoutes(router.routes, ' ', _components, 2)
|
||||
Vue.use(Router)
|
||||
|
||||
<% if (router.scrollBehavior) { %>
|
||||
const scrollBehavior = <%= serialize(router.scrollBehavior).replace(/scrollBehavior\s*\(/, 'function(').replace('function function', 'function') %>
|
||||
const scrollBehavior = <%= serializeFunction(router.scrollBehavior) %>
|
||||
<% } else { %>
|
||||
if (process.client) {
|
||||
window.history.scrollRestoration = 'manual'
|
||||
@ -112,8 +112,8 @@ export function createRouter() {
|
||||
<%= isTest ? '/* eslint-disable quotes */' : '' %>
|
||||
routes: [<%= _routes %>],
|
||||
<%= isTest ? '/* eslint-enable quotes */' : '' %>
|
||||
<% if (router.parseQuery) { %>parseQuery: <%= serialize(router.parseQuery).replace('parseQuery(', 'function(') %>,<% } %>
|
||||
<% if (router.stringifyQuery) { %>stringifyQuery: <%= serialize(router.stringifyQuery).replace('stringifyQuery(', 'function(') %>,<% } %>
|
||||
<% if (router.parseQuery) { %>parseQuery: <%= serializeFunction(router.parseQuery) %>,<% } %>
|
||||
<% if (router.stringifyQuery) { %>stringifyQuery: <%= serializeFunction(router.stringifyQuery) %>,<% } %>
|
||||
fallback: <%= router.fallback %>
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user