Merge pull request #94 from itldg/master

优化下拉框筛选后重新调整uTools高度
This commit is contained in:
fofolee 2025-04-11 10:45:13 +08:00 committed by GitHub
commit 0979e5648c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,9 +114,13 @@ export default {
return this.items.filter((x) => {
if (this.is.json) {
const titleMatch = window.pinyinMatch.match(x.title, this.searchWords);
const titleMatch = window.pinyinMatch.match(
x.title,
this.searchWords
);
const descMatch =
x.description && window.pinyinMatch.match(x.description, this.searchWords);
x.description &&
window.pinyinMatch.match(x.description, this.searchWords);
return titleMatch || descMatch;
} else {
return window.pinyinMatch.match(x, this.searchWords);
@ -212,6 +216,7 @@ export default {
this.searchWords = text;
if (this.matchedItems.length < this.currentIndex + 1)
this.currentIndex = 0;
this.setUtoolsHeight(this.itemHeight * this.matchedItemsSize);
}, this.options.options.placeholder);
},