Feature: add gallery db

This commit is contained in:
PiEgg
2021-07-27 11:58:24 +08:00
parent c70c3aff78
commit 6ddd660d89
6 changed files with 14 additions and 15 deletions

View File

@@ -199,10 +199,14 @@ export default class extends Vue {
return this.images
.filter(item => {
let isInChoosedPicBed = true
let isIncludesSearchText = true
if (this.choosedPicBed.length > 0) {
isInChoosedPicBed = this.choosedPicBed.some(type => type === item.type)
}
return item.fileName?.includes(this.searchText) && isInChoosedPicBed
if (this.searchText) {
isIncludesSearchText = item.fileName?.includes(this.searchText) || false
}
return isIncludesSearchText && isInChoosedPicBed
})
} else {
return this.images