File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ const cacheData = ref<TorrentCacheData>({
3030})
3131
3232// 筛选条件
33- const titleFilter = ref ( ' ' )
34- const siteFilter = ref ( ' ' )
33+ const titleFilter = ref < string | null >( null )
34+ const siteFilter = ref < string | null >( null )
3535
3636// 获取所有站点选项
3737const siteOptions = computed (() => {
@@ -47,7 +47,7 @@ const siteOptions = computed(() => {
4747// 筛选后的数据
4848const filteredData = computed (() => {
4949 return cacheData .value .data .filter (item => {
50- const titleMatch = item .title .toLowerCase ().includes (titleFilter .value .toLowerCase ())
50+ const titleMatch = ! titleFilter . value || item .title ? .toLowerCase ().includes (titleFilter .value ? .toLowerCase ())
5151 const siteMatch = ! siteFilter .value || item .site_name === siteFilter .value
5252 return titleMatch && siteMatch
5353 })
You can’t perform that action at this time.
0 commit comments