fix: scroll to hash
This commit is contained in:
@@ -20,7 +20,15 @@ import { getApiErrorStatus } from "@/utils/api-error";
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
scrollBehavior() {
|
||||
scrollBehavior(to, _from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition;
|
||||
}
|
||||
|
||||
if (to.hash) {
|
||||
return { el: to.hash, top: 68 };
|
||||
}
|
||||
|
||||
return { left: 0, top: 0 };
|
||||
},
|
||||
routes: [
|
||||
|
||||
Reference in New Issue
Block a user