diff --git a/lib/app/router.js b/lib/app/router.js index c07a1bc957..dd86d4b680 100644 --- a/lib/app/router.js +++ b/lib/app/router.js @@ -35,7 +35,7 @@ const _routes = recursiveRoutes(router.routes, '\t\t', _components) Vue.use(Router) <% if (router.scrollBehavior) { %> -const scrollBehavior = <%= serialize(router.scrollBehavior).replace('scrollBehavior(', 'function(').replace('function function', 'function') %> +const scrollBehavior = <%= serialize(router.scrollBehavior).replace(/scrollBehavior\s*\(/, 'function(').replace('function function', 'function') %> <% } else { %> if (process.client) { window.history.scrollRestoration = 'manual'