From 44c3091951c09d7252a02dad6ee7cf8333de7abf Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 8 Aug 2025 13:50:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/components/MenuComponent.vue | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/frontend_nuxt/components/MenuComponent.vue b/frontend_nuxt/components/MenuComponent.vue index c28ef69ef..60b0481ec 100644 --- a/frontend_nuxt/components/MenuComponent.vue +++ b/frontend_nuxt/components/MenuComponent.vue @@ -131,12 +131,11 @@ export default { const tags = ref([]) const categoryOpen = ref(true) const tagOpen = ref(true) - - const { data: categoryData, pending: isLoadingCategory } = await useFetch( + const { data: categoryData, pending: isLoadingCategory } = await fetch( `${API_BASE_URL}/api/categories`, { server: true } ) - const { data: tagData, pending: isLoadingTag } = await useFetch( + const { data: tagData, pending: isLoadingTag } = await fetch( `${API_BASE_URL}/api/tags?limit=10`, { server: true } ) @@ -210,19 +209,39 @@ export default { const gotoCategory = (c) => { const value = encodeURIComponent(c.id ?? c.name) - this.$router + router .push({ path: '/', query: { category: value } }).then(() => { window.location.reload() }) - this.handleItemClick() - }, - gotoTag(t) { + handleItemClick() + } + + const gotoTag = (t) => { const value = encodeURIComponent(t.id ?? t.name) - this.$router + router .push({ path: '/', query: { tags: value } }).then(() => { window.location.reload() }) - this.handleItemClick() + handleItemClick() + } + + return { + categories, + tags, + categoryOpen, + tagOpen, + isLoadingCategory, + isLoadingTag, + iconClass, + unreadCount, + showUnreadCount, + shouldShowStats, + cycleTheme, + handleHomeClick, + handleItemClick, + isImageIcon, + gotoCategory, + gotoTag } } }