add scroll to top
This commit is contained in:
1 parent
1988ccfd5e
commit
e04f6156cb
1 file changed
+12
-1
+12
-1
@@ -14,7 +14,18 @@ const router = new Router({
|
||||
{ path: "/p", component: Single },
|
||||
{ path: "/p/:y/:mo/:name", component: Single },
|
||||
{ path: "/about", component: About }
|
||||
]
|
||||
],
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition;
|
||||
} else if (to.hash) {
|
||||
return {
|
||||
selector: to.hash
|
||||
};
|
||||
} else {
|
||||
return { x: 0, y: 0 }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("click", (ev) => {
|
||||
|
||||
Reference in new issue
Block a user