mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-02-02 18:28:40 +08:00
parent
7ffe1726b9
commit
d709dd67b5
@ -101,11 +101,10 @@ function createScrollGuard(router: Router) {
|
|||||||
return /^#/.test(href);
|
return /^#/.test(href);
|
||||||
};
|
};
|
||||||
|
|
||||||
const body = document.body;
|
|
||||||
|
|
||||||
router.afterEach(async (to) => {
|
router.afterEach(async (to) => {
|
||||||
// scroll top
|
// scroll top
|
||||||
isHash((to as RouteLocationNormalized & { href: string })?.href) && body.scrollTo(0, 0);
|
isHash((to as RouteLocationNormalized & { href: string })?.href) &&
|
||||||
|
document.querySelector('.vben-layout-content')?.scrollTo(0, 0);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user