We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee11d6f commit 859aec6Copy full SHA for 859aec6
1 file changed
src/router/index.ts
@@ -54,7 +54,7 @@ router.afterEach((to, from) => {
54
// 进度条
55
window.$loadingBar.finish();
56
// 路由变化时重置滚动位置(排除仅 hash 变化的情况)
57
- if (to.path !== from.path || to.query.id !== from.query.id) {
+ if (to.fullPath.split("#")[0] !== from.fullPath.split("#")[0]) {
58
const mainContent = document.getElementById("main-content");
59
if (mainContent) {
60
const scrollContainer = mainContent.querySelector(".n-scrollbar-container");
0 commit comments