From 111877f4e010f23d21dde7433ffba278e55a6ee3 Mon Sep 17 00:00:00 2001 From: jlpereira Date: Tue, 12 Sep 2023 15:40:23 -0300 Subject: [PATCH] Fix router scroll --- src/router/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 9b7dd05..9e2d8d8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -40,9 +40,9 @@ export function createRouter() { history: getHistory(), routes, scrollBehavior(to, from, savedPosition) { - if (to.hash) { - return { el: to.hash } - } + return to.hash + ? { el: to.hash } + : { top: 0 } } }) }