Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ export default {
// (optional)
minChars: 3,

// If to auto select the first item in the list
// (optional)
selectFirst: false,

// Override the default value (`q`) of query parameter name
// Use a falsy value for RESTful query
// (optional)
Expand Down
7 changes: 6 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default {
query: '',
current: -1,
loading: false,
queryParamName: 'q'
selectFirst: false,
queryParamName: 'q',
}
},

Expand Down Expand Up @@ -44,6 +45,10 @@ export default {
this.items = this.limit ? data.slice(0, this.limit) : data
this.current = -1
this.loading = false

if (this.selectFirst && this.items.length >= 1) {
this.down()
}
}
})
},
Expand Down