Skip to content

Commit

Permalink
fix: highlight active link (#272) doesn't work with non-EN hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed May 17, 2018
1 parent 27acbdf commit a51a31b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/default-theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ export default {
(scrollTop >= anchor.parentElement.offsetTop + 10 &&
(!nextAnchor || scrollTop < nextAnchor.parentElement.offsetTop - 10))
if (isActive && this.$route.hash !== anchor.hash) {
if (isActive && decodeURIComponent(this.$route.hash) !== decodeURIComponent(anchor.hash)) {
store.disableScrollBehavior = true
this.$router.replace(anchor.hash, () => {
this.$router.replace(decodeURIComponent(anchor.hash), () => {
// execute after scrollBehavior handler.
this.$nextTick(() => {
store.disableScrollBehavior = false
Expand Down

0 comments on commit a51a31b

Please sign in to comment.