From c08bd46aa757e7a0bc28b2318fb38037d583b27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=83=BD=E5=AE=81?= Date: Thu, 12 Oct 2023 20:39:54 +0800 Subject: [PATCH] fix(theme): search's configuration about buttonAriaLabel doesn't work (#3070) --- .../components/VPLocalSearchBox.vue | 18 ++++++++++----- .../components/VPNavBarSearch.vue | 21 +++--------------- .../components/VPNavBarSearchButton.vue | 22 ++++++++++++++----- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index bf0ab4c3b09e..1fde6c4d140f 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -31,10 +31,6 @@ import { pathToFile } from '../../app/utils' import { useData } from '../composables/data' import { createTranslate } from '../support/translation' -defineProps<{ - placeholder: string -}>() - const emit = defineEmits<{ (e: 'close'): void }>() @@ -115,6 +111,16 @@ const disableDetailedView = computed(() => { ) }) +const buttonText = computed(() => { + const options = theme.value.search?.options ?? theme.value.algolia + + return ( + options?.locales?.[localeIndex.value]?.translations?.button?.buttonText || + options?.translations?.button?.buttonText || + 'Search' + ) +}) + watchEffect(() => { if (disableDetailedView.value) { showDetailedList.value = false @@ -414,7 +420,7 @@ function formMarkRegex(terms: Set) { @submit.prevent="" >