From b3f82f53e9afe006912ab3771df708b34f919cb4 Mon Sep 17 00:00:00 2001 From: Mister-Hope Date: Mon, 16 Dec 2024 23:33:29 +0800 Subject: [PATCH] fix: fix DocSearch version --- src/.vuepress/client.ts | 4 ++++ src/.vuepress/components/DocSearch.vue | 31 ++++++++++++++++++++++++++ src/.vuepress/theme.ts | 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/.vuepress/components/DocSearch.vue diff --git a/src/.vuepress/client.ts b/src/.vuepress/client.ts index bdbe4acd..7464fa71 100644 --- a/src/.vuepress/client.ts +++ b/src/.vuepress/client.ts @@ -19,9 +19,13 @@ import { defineDocSearchConfig } from '@vuepress/plugin-docsearch/client'; import { computed } from 'vue'; import { defineClientConfig, usePageData } from 'vuepress/client'; +import DocSearch from './components/DocSearch.vue'; import { getDocVersion } from './utils/index.js'; export default defineClientConfig({ + enhance: ({ app }) => { + app.component('DocSearch', DocSearch); + }, setup() { const pageData = usePageData(); diff --git a/src/.vuepress/components/DocSearch.vue b/src/.vuepress/components/DocSearch.vue new file mode 100644 index 00000000..3ce085fc --- /dev/null +++ b/src/.vuepress/components/DocSearch.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/.vuepress/theme.ts b/src/.vuepress/theme.ts index 780c6d12..6b209388 100644 --- a/src/.vuepress/theme.ts +++ b/src/.vuepress/theme.ts @@ -38,7 +38,7 @@ export default hopeTheme( navbarLayout: { start: ['Brand'], center: [], - end: ['Search', 'Links', 'Language', 'Outlook', 'Repo'], + end: ['DocSearch', 'Links', 'Language', 'Outlook', 'Repo'], }, locales: {