From be9ef049f9deeda1f28eef383e082a3f3c08bf54 Mon Sep 17 00:00:00 2001 From: wonderl17 <31885971+wonderl17@users.noreply.github.com> Date: Fri, 24 Feb 2023 18:04:36 +0800 Subject: [PATCH] fix(docs): [search] fix navigate error when enter pressed (#11718) --- docs/.vitepress/vitepress/components/navbar/vp-search.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/.vitepress/vitepress/components/navbar/vp-search.vue b/docs/.vitepress/vitepress/components/navbar/vp-search.vue index 8020861b8b..1eab8da1a3 100644 --- a/docs/.vitepress/vitepress/components/navbar/vp-search.vue +++ b/docs/.vitepress/vitepress/components/navbar/vp-search.vue @@ -72,19 +72,19 @@ function initialize(userOptions: any) { // }), navigator: { - navigate: ({ suggestionUrl }: { suggestionUrl: string }) => { + navigate: ({ itemUrl }: { itemUrl: string }) => { if (!isClient) return const { pathname: hitPathname } = new URL( - window.location.origin + suggestionUrl + window.location.origin + itemUrl ) // Router doesn't handle same-page navigation so we use the native // browser location API for anchor navigation if (route.path === hitPathname) { - window.location.assign(window.location.origin + suggestionUrl) + window.location.assign(window.location.origin + itemUrl) } else { - router.go(suggestionUrl) + router.go(itemUrl) } }, },