From d4563b7f858e95dd9849a1310c82c38ffff058ff Mon Sep 17 00:00:00 2001 From: Artur Wronski Date: Tue, 29 Aug 2017 14:19:06 +0200 Subject: [PATCH] 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 --- lib/app/router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/router.js b/lib/app/router.js index a5b2b51351..8312556090 100644 --- a/lib/app/router.js +++ b/lib/app/router.js @@ -24,7 +24,7 @@ uniqBy(_components, '_name').forEach((route) => { %>const <%= route._name %> = ( <% }) %> <% if (router.scrollBehavior) { %> -const scrollBehavior = <%= serialize(router.scrollBehavior).replace('scrollBehavior(', 'function(') %> +const scrollBehavior = <%= serialize(router.scrollBehavior).replace('scrollBehavior(', 'function(').replace('function function', 'function') %> <% } else { %> const scrollBehavior = (to, from, savedPosition) => { // SavedPosition is only available for popstate navigations.