diff --git a/lib/app/router.js b/lib/app/router.js index e603f68cb4..a85f2d5925 100644 --- a/lib/app/router.js +++ b/lib/app/router.js @@ -35,6 +35,9 @@ const scrollBehavior = (to, from, savedPosition) => { if (to.matched.length < 2) { position = { x: 0, y: 0 } } + else if (to.matched.some((r) => r.components.default.scrollToTop || (r.components.default.options && r.components.default.options.scrollToTop))) { + position = { x: 0, y: 0 } + } // if link has anchor, scroll to anchor by returning the selector if (to.hash) { position = { selector: to.hash }