diff --git a/src/components/GlossarySearchNav.vue b/src/components/GlossarySearchNav.vue index 32b5198..b096ae4 100644 --- a/src/components/GlossarySearchNav.vue +++ b/src/components/GlossarySearchNav.vue @@ -33,17 +33,13 @@ import { useRoute } from 'vue-router'; import { SEARCH_LINKS_COLOR as searchLinksColorSetting } from '../obp/style-setting'; const route = useRoute() -const activeKeys = ref([]) -const glossaryKeys = ref([]) -const alphabet = ref([]) +const activeKeys = ref([]) +const glossaryKeys = ref([]) const searchLinksColor = ref(searchLinksColorSetting) const form = reactive({ search: '' }) -const alphabetCharCodes = Array.from(Array(26)).map((e, i) => i + 65) -alphabet.value = alphabetCharCodes.map((x) => String.fromCharCode(x)) - onBeforeMount(() => { const glossary = inject(obpGlossaryKey)! for (const item of glossary.glossary_items) { @@ -60,17 +56,17 @@ onMounted(() => { let hash = route.hash; let elements = document.querySelectorAll(`a[href="${hash}"][class="glossary-router-link"]`) if (elements.length == 1) { - elements[0].click() + (elements[0] as HTMLElement).click() } }) -const filterKeys = (keys, key) => { - return keys.filter((title) => { +const filterKeys = (keys: string[], key: string) => { + return keys.filter((title: string) => { return title.toLowerCase().includes(key.toLowerCase()) }) } -const searchEvent = (event) => { +const searchEvent = (event: string) => { if (event) { glossaryKeys.value = filterKeys(activeKeys.value, event).sort() } else { @@ -81,52 +77,18 @@ const searchEvent = (event) => { diff --git a/src/components/HeaderNav.vue b/src/components/HeaderNav.vue index 49a86d3..c510a09 100644 --- a/src/components/HeaderNav.vue +++ b/src/components/HeaderNav.vue @@ -137,25 +137,31 @@ const getCurrentPath = () => { {{ $t('header.api_manager') }} - - - - {{ $t('header.more') }} - - - - - - - + + + {{ $t('header.more') }} + + + + + +