diff --git a/frontend_nuxt/components/Dropdown.vue b/frontend_nuxt/components/Dropdown.vue index 79d2a44d6..583198dd7 100644 --- a/frontend_nuxt/components/Dropdown.vue +++ b/frontend_nuxt/components/Dropdown.vue @@ -168,9 +168,19 @@ export default { const mobileMenuRef = ref(null) const isMobile = useIsMobile() + const openMenu = () => { + if (!open.value) { + open.value = true + } + } + const toggle = () => { - open.value = !open.value - if (!open.value) emit('close') + if (open.value) { + open.value = false + emit('close') + } else { + open.value = true + } } const close = () => { @@ -275,7 +285,7 @@ export default { return /^https?:\/\//.test(icon) || icon.startsWith('/') } - expose({ toggle, close, reload, scrollToBottom }) + expose({ toggle, close, reload, scrollToBottom, openMenu }) return { open, diff --git a/frontend_nuxt/components/SearchDropdown.vue b/frontend_nuxt/components/SearchDropdown.vue index 8d84733ad..a10e4e8d9 100644 --- a/frontend_nuxt/components/SearchDropdown.vue +++ b/frontend_nuxt/components/SearchDropdown.vue @@ -18,6 +18,7 @@ class="text-input" v-model="keyword" placeholder="键盘点击「/」以触发搜索" + ref="searchInput" @input="setSearch(keyword)" /> @@ -48,7 +49,7 @@