I come from AngularJS and, at certain times, when I need to query according to what the user is searching, I use ng-change
, but I combine it with ng-model-options="{debounce: 500}"
. This causes the angular queries not to fire off queries like crazy on my server, but it only makes the search done when it stops typing.
I wanted to do the same thing with Vue, but the option debounce
was deprecated in version 2.0 +.
What now? How could I do in VueJS to be able to execute a @input
only when the user stops typing?
Is there such a thing in VueJS ready, or will I have to do it "on hand"?
Example:
<input type="text"
v-model="pesquisa.nome"
@input="consultarSoQuandoPararDeDigitar()" />