diff --git a/app/router.scrollBehavior.js b/app/router.scrollBehavior.js new file mode 100644 index 00000000..602e116c --- /dev/null +++ b/app/router.scrollBehavior.js @@ -0,0 +1,10 @@ +/** + * https://nuxtjs.org/docs/configuration-glossary/configuration-router/#scrollbehavior + * always scrollToTop but on index page + */ +export default function (to, _from, savedPosition) { + if (to.name === 'index') { + return savedPosition + } + return { x: 0, y: 0 } +}