From a51a31b7245af525981313e535061968def4062c Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Thu, 17 May 2018 22:50:27 +0800 Subject: [PATCH] fix: highlight active link (#272) doesn't work with non-EN hash. --- lib/default-theme/Layout.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default-theme/Layout.vue b/lib/default-theme/Layout.vue index 9e54d0f248..c794f6a753 100644 --- a/lib/default-theme/Layout.vue +++ b/lib/default-theme/Layout.vue @@ -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