From 644142b065018e0be6b9ff8559b5ff0e8ba9873c Mon Sep 17 00:00:00 2001
From: Kid <kidonng@gmail.com>
Date: Sat, 20 Jul 2019 15:19:54 +0800
Subject: [PATCH] feat(theme-default): use router for Algolia search to reach
 no refresh (#1706)

---
 .../@vuepress/theme-default/components/AlgoliaSearchBox.vue  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue b/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue
index 41b62af263..a7a6c0985b 100644
--- a/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue
+++ b/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue
@@ -35,7 +35,10 @@ export default {
             // #697 Make docsearch work well at i18n mode.
             algoliaOptions: Object.assign({
               'facetFilters': [`lang:${lang}`].concat(algoliaOptions.facetFilters || [])
-            }, algoliaOptions)
+            }, algoliaOptions),
+            handleSelected: (input, event, suggestion) => {
+              this.$router.push(new URL(suggestion.url).pathname)
+            }
           }
         ))
       })