From 56692eb6cb98338620528f41e409521478ac84eb Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 29 Apr 2024 14:51:00 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=90=9C=E7=B4=A2=E6=A1=86=E8=AE=B0?= =?UTF-8?q?=E5=BF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/components/SearchBar.vue | 12 +++++++++--- src/views/plugin/PluginCardListView.vue | 5 ++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/layouts/components/SearchBar.vue b/src/layouts/components/SearchBar.vue index c11cb1e2..087142b9 100644 --- a/src/layouts/components/SearchBar.vue +++ b/src/layouts/components/SearchBar.vue @@ -14,10 +14,13 @@ const searchWordInput = ref(null) // 当前的搜索类型 media/person const searchType = ref('media') +// 搜索提示词列表 +const searchHintList = ref([]) + // Search function search() { if (!searchWord.value) return - + if (!searchHintList.value.includes(searchWord.value)) searchHintList.value.push(searchWord.value) searchDialog.value = false router.push({ path: '/browse/media/search', @@ -51,13 +54,15 @@ function openSearchDialog() { - @@ -76,9 +81,10 @@ function openSearchDialog() { - { }) } else if (activeSort.value) { return ret_list.sort((a: any, b: any) => { - return a[activeSort.value] > b[activeSort.value] ? 1 : -1 + return a[activeSort.value ?? ''] > b[activeSort.value ?? ''] ? 1 : -1 }) } })