Here is an example of an input box I am working with:
<b-row>
<b-col md="3"
v-for="(header, index) in columns"
:key="index"
>
<b-form-group>
<b-form-input
placeholder="Search"
type="text"
class="d-inline-block"
@input="advanceSearch($event, header.field)"
/>
</b-form-group>
</b-col>
</b-row>
Whenever the user types something, I save the input to a variable called searchString
:
advanceSearch(e, field) {
this.searchString.push({
[field] : e
});
// http.post().then().catch(); // my http call
},
I would like to make the HTTP request only when the user has finished typing. Currently, it seems to be making a request after every keystroke.
Is there a way to achieve this in VUE JS?