Commit 8327d840 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt

only reset scroll position if page changed

parent 7e1811ec
Pipeline #2010 passed with stages
in 4 minutes and 42 seconds
......@@ -8,8 +8,11 @@ Vue.use(Router)
const router = new Router({
mode: 'history',
base: process.env.BASE_URL,
scrollBehavior () {
return { x: 0, y: 0 }
scrollBehavior (to, from) {
return {
x: 0,
y: from.name === to.name ? document.scrollingElement.scrollTop : 0
}
},
routes: [
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment