Skip to content

Commit 7ad0a42

Browse files
janvennemannulivz
authored andcommitted
fix: re-enable scroll to anchor behavior (close: #1107)(#1108)
1 parent 9a4b615 commit 7ad0a42

File tree

1 file changed

+5
-2
lines changed
  • packages/@vuepress/core/lib/app

1 file changed

+5
-2
lines changed

packages/@vuepress/core/lib/app/app.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ export function createApp (isServer) {
6666
scrollBehavior (to, from, savedPosition) {
6767
if (savedPosition) {
6868
return savedPosition
69-
}
70-
if (to.path !== from.path) {
69+
} else if (to.hash) {
70+
return {
71+
selector: to.hash
72+
}
73+
} else {
7174
return { x: 0, y: 0 }
7275
}
7376
}

0 commit comments

Comments
 (0)