Skip to content

Commit 90abaa5

Browse files
authored
fix($theme-default): When use algolia search input and the hash is Chinese, the router will report an error (fix vuejs#2431)
1 parent 54b84b3 commit 90abaa5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ export default {
5959
handleSelected: (input, event, suggestion) => {
6060
const { pathname, hash } = new URL(suggestion.url)
6161
const routepath = pathname.replace(this.$site.base, '/')
62-
this.$router.push(`${routepath}${hash}`)
62+
const _hash = decodeURIComponent(hash)
63+
this.$router.push(`${routepath}${_hash}`)
6364
}
6465
}
6566
))

0 commit comments

Comments
 (0)