Skip to content

Commit 859aec6

Browse files
committed
Update index.ts
1 parent ee11d6f commit 859aec6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ router.afterEach((to, from) => {
5454
// 进度条
5555
window.$loadingBar.finish();
5656
// 路由变化时重置滚动位置(排除仅 hash 变化的情况)
57-
if (to.path !== from.path || to.query.id !== from.query.id) {
57+
if (to.fullPath.split("#")[0] !== from.fullPath.split("#")[0]) {
5858
const mainContent = document.getElementById("main-content");
5959
if (mainContent) {
6060
const scrollContainer = mainContent.querySelector(".n-scrollbar-container");

0 commit comments

Comments
 (0)