fix: 筛选出现的bug #28

This commit is contained in:
thofx
2023-08-31 22:34:39 +08:00
parent 6fc3228334
commit 2351ec7b85
2 changed files with 5 additions and 3 deletions
+1
View File
@@ -59,6 +59,7 @@
"@iconify/vue": "4.1.1", "@iconify/vue": "4.1.1",
"@intlify/unplugin-vue-i18n": "^0.10.0", "@intlify/unplugin-vue-i18n": "^0.10.0",
"@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/aspect-ratio": "^0.4.2",
"@types/lodash": "^4.14.197",
"@types/node": "^20.1.4", "@types/node": "^20.1.4",
"@types/webfontloader": "^1.6.34", "@types/webfontloader": "^1.6.34",
"@typescript-eslint/eslint-plugin": "^5.59.5", "@typescript-eslint/eslint-plugin": "^5.59.5",
+3 -2
View File
@@ -1,5 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import _ from 'lodash'
import api from '@/api' import api from '@/api'
import type { Context } from '@/api/types' import type { Context } from '@/api/types'
import TorrentCard from '@/components/cards/TorrentCard.vue' import TorrentCard from '@/components/cards/TorrentCard.vue'
@@ -111,7 +112,7 @@ watchEffect(() => {
) )
}) })
if (matchData.length > 0) { if (matchData.length > 0) {
const firstData = matchData[0] as SearchTorrent const firstData = _.cloneDeepWith(matchData[0]) as SearchTorrent
if (matchData.length > 1) if (matchData.length > 1)
firstData.more = matchData.slice(1) firstData.more = matchData.slice(1)
@@ -312,7 +313,7 @@ onMounted(initData)
<span>{{ progressText }}</span> <span>{{ progressText }}</span>
</div> </div>
<div v-if="dataList.length > 0" class="grid gap-3 grid-torrent-card items-start"> <div v-if="dataList.length > 0" class="grid gap-3 grid-torrent-card items-start">
<TorrentCard v-for="data in dataList" :key="`${data.torrent_info.title}_${data.torrent_info.site}`" :torrent="data" :more="data.more" /> <TorrentCard v-for="data in dataList" :key="`${data.torrent_info.title}_${data.torrent_info.site_name}_${data.torrent_info.page_url}`" :torrent="data" :more="data.more" />
</div> </div>
<NoDataFound <NoDataFound
v-if="dataList.length === 0 && isRefreshed" v-if="dataList.length === 0 && isRefreshed"