Skip to content

Commit

Permalink
fix: re-enable scroll to anchor behavior (close: #1107)(#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
janvennemann authored and ulivz committed Dec 17, 2018
1 parent 9a4b615 commit 7ad0a42
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/@vuepress/core/lib/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ export function createApp (isServer) {
scrollBehavior (to, from, savedPosition) {
if (savedPosition) {
return savedPosition
}
if (to.path !== from.path) {
} else if (to.hash) {
return {
selector: to.hash
}
} else {
return { x: 0, y: 0 }
}
}
Expand Down

0 comments on commit 7ad0a42

Please sign in to comment.