Use a custom hook to reset scroll before each route unlike scrollbehavior
parent
78b3cb16f4
commit
f50c9b46f7
|
@ -162,6 +162,11 @@ Vue.component('Galleria', Galleria);
|
||||||
|
|
||||||
Vue.component('CodeHighlight', CodeHighlight);
|
Vue.component('CodeHighlight', CodeHighlight);
|
||||||
|
|
||||||
|
router.beforeEach(function (to, from, next) {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
render: h => h(App)
|
render: h => h(App)
|
||||||
|
|
|
@ -675,8 +675,5 @@ export default new Router({
|
||||||
name: 'galleriacaption',
|
name: 'galleriacaption',
|
||||||
component: () => import('./views/galleria/GalleriaCaptionDemo.vue')
|
component: () => import('./views/galleria/GalleriaCaptionDemo.vue')
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
scrollBehavior() {
|
|
||||||
return {x: 0, y: 0};
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue