列表长度超出选中对象的索引时,索引重置为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

1
.gitignore vendored
View File

@ -32,3 +32,4 @@ yarn-error.log*
*.njsproj
*.sln
.vscode
.vscode/**

13
.vscode/settings.json vendored
View File

@ -3,16 +3,9 @@
"editor.guides.bracketPairs": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": [
"source.fixAll.eslint"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"vue"
],
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
"editor.defaultFormatter": "Vue.volar"
}
}

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);
},