From ef40efb9a036aad57ea53ffc89a71db71f3f49f7 Mon Sep 17 00:00:00 2001 From: Kid Date: Thu, 15 Aug 2019 20:21:08 +0800 Subject: [PATCH] fix: add missing hash in #1706 --- .../@vuepress/theme-default/components/AlgoliaSearchBox.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue b/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue index a7a6c0985b..f4ff3ffbd0 100644 --- a/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue +++ b/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue @@ -37,7 +37,8 @@ export default { 'facetFilters': [`lang:${lang}`].concat(algoliaOptions.facetFilters || []) }, algoliaOptions), handleSelected: (input, event, suggestion) => { - this.$router.push(new URL(suggestion.url).pathname) + const { pathname, hash } = new URL(suggestion.url) + this.$router.push(`${pathname}${hash}`) } } ))