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 } } }) }