I would like to wait for user input and as soon as the user stops typing do a search. I'm using a filter component that communicates with a data grid. As soon as the user finishes typing or selecting the options of a multiple select, the search (filtering) will be carried out.
I tried using the debounce from lodash but couldn't use it.
data() {
nameOrCpfDebounce: ""
}
methods: {
nameOrCpfDebounce: function() {
this.nameOrCpfDebounce = debounce(
value => (this.filters.nameOrCpf = value),
3000
);
},
}
<TextField label="Nome ou CPF" @input="nameOrCpfDebounce" />