列表长度超出选中对象的索引时,索引重置为0

This commit is contained in:
fofolee
2024-01-26 12:46:18 +08:00
parent f0069e2a16
commit 2b088a76ce
3 changed files with 11 additions and 16 deletions

View File

@@ -196,6 +196,7 @@ export default {
setSubInput() {
utools.setSubInput(({ text }) => {
this.searchWords = text;
if (this.matchedItems.length < this.currentIndex + 1) this.currentIndex = 0
}, this.options.options.placeholder);
},