Limit search characters before making the search request
This commit is contained in:
parent
d038a93d65
commit
785b303166
1 changed files with 3 additions and 1 deletions
|
@ -39,7 +39,9 @@ export default {
|
||||||
this.searchQuery = e.target.value;
|
this.searchQuery = e.target.value;
|
||||||
clearTimeout(this.debounce);
|
clearTimeout(this.debounce);
|
||||||
this.debounce = setTimeout(async () => {
|
this.debounce = setTimeout(async () => {
|
||||||
|
if (this.searchQuery.length > 2) {
|
||||||
this.$emit('search', this.searchQuery);
|
this.$emit('search', this.searchQuery);
|
||||||
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
},
|
},
|
||||||
focusSearch(e) {
|
focusSearch(e) {
|
||||||
|
|
Loading…
Reference in a new issue