fix: compile error when using scrollBehavior

When compiling with babel as middleware the scrollBehavior function was transpiling in
incorrect way. Double function function

fixes #1516
This commit is contained in:
Artur Wronski 2017-08-29 14:19:06 +02:00
parent 138edc7bfd
commit d4563b7f85
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ uniqBy(_components, '_name').forEach((route) => { %>const <%= route._name %> = (
<% }) %> <% }) %>
<% if (router.scrollBehavior) { %> <% if (router.scrollBehavior) { %>
const scrollBehavior = <%= serialize(router.scrollBehavior).replace('scrollBehavior(', 'function(') %> const scrollBehavior = <%= serialize(router.scrollBehavior).replace('scrollBehavior(', 'function(').replace('function function', 'function') %>
<% } else { %> <% } else { %>
const scrollBehavior = (to, from, savedPosition) => { const scrollBehavior = (to, from, savedPosition) => {
// SavedPosition is only available for popstate navigations. // SavedPosition is only available for popstate navigations.