From 429cc3b795ad496e42a224a8e8b85b98ec255263 Mon Sep 17 00:00:00 2001 From: rookie4show Date: Wed, 19 Mar 2025 11:25:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=8F=E7=A5=9E=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ShikigamiSelect.vue | 33 ++++++++++++++++++++++++------ src/data/updateLog.json | 7 +++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/components/ShikigamiSelect.vue b/src/components/ShikigamiSelect.vue index 0a1a581..dd78c9f 100644 --- a/src/components/ShikigamiSelect.vue +++ b/src/components/ShikigamiSelect.vue @@ -6,11 +6,19 @@ :before-close="cancel" > 当前选择式神:{{ current.name }} +
+ +
-
+
{ const confirm = (shikigami: Shikigami) => { emit('updateShikigami', shikigami) + searchText.value='' + activeName.value='ALL' // cancel() } -const filterShikigamiByRarity = (rarity: string) => { - if (rarity.toLowerCase() === 'all') return shikigamiData - return shikigamiData.filter(item => - item.rarity.toLowerCase() === rarity.toLowerCase() - ) + +// 修改后的过滤函数 +const filterShikigamiByRarityAndSearch = (rarity: string, search: string) => { + let filteredList = shikigamiData; + if (rarity.toLowerCase() !== 'all') { + filteredList = filteredList.filter(item => + item.rarity.toLowerCase() === rarity.toLowerCase() + ); + } + if (search.trim() !== '') { + return filteredList.filter(item => + item.name.toLowerCase().includes(search.toLowerCase()) + ); + } + return filteredList; } \ No newline at end of file diff --git a/src/data/updateLog.json b/src/data/updateLog.json index cdb89fd..b35ec09 100644 --- a/src/data/updateLog.json +++ b/src/data/updateLog.json @@ -1,4 +1,11 @@ [ + { + "version": "2.1.0", + "date": "2025-03-19", + "changes": [ + "增加式神搜索功能" + ] + }, { "version": "2.0.2", "date": "2025-03-19",