mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Fix scrolling issue.
Looks like Vue Router's scrollBehavior is broken.
This commit is contained in:
parent
aa81677450
commit
29b49de40c
2 changed files with 4 additions and 0 deletions
|
@ -149,6 +149,7 @@ export default {
|
||||||
this.getVideoData();
|
this.getVideoData();
|
||||||
this.getSponsors();
|
this.getSponsors();
|
||||||
this.getComments();
|
this.getComments();
|
||||||
|
window.scrollTo(0, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,6 +34,9 @@ const routes = [
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(),
|
||||||
routes,
|
routes,
|
||||||
|
scrollBehavior: function(_to, _from, savedPosition) {
|
||||||
|
return savedPosition ? savedPosition : window.scrollTo(0, 0);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|
Loading…
Reference in a new issue