Skip to content

Commit a51a31b

Browse files
committed
fix: highlight active link (#272) doesn't work with non-EN hash.
1 parent 27acbdf commit a51a31b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/default-theme/Layout.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ export default {
150150
(scrollTop >= anchor.parentElement.offsetTop + 10 &&
151151
(!nextAnchor || scrollTop < nextAnchor.parentElement.offsetTop - 10))
152152
153-
if (isActive && this.$route.hash !== anchor.hash) {
153+
if (isActive && decodeURIComponent(this.$route.hash) !== decodeURIComponent(anchor.hash)) {
154154
store.disableScrollBehavior = true
155-
this.$router.replace(anchor.hash, () => {
155+
this.$router.replace(decodeURIComponent(anchor.hash), () => {
156156
// execute after scrollBehavior handler.
157157
this.$nextTick(() => {
158158
store.disableScrollBehavior = false

0 commit comments

Comments
 (0)