I am struggling to implement a search feature with three fields - one input and two selectors. I was able to get it to work with two fields, but adding the third is causing issues. I could really use some guidance on this.
computed: {
filterMembers: function () {
let filtered = this.trabalinhos;
if (this.searchText) {
filtered = this.trabalinhos.filter(
(m) => m.title.toLowerCase().indexOf(this.searchText) > -1
);
}
if (this.searchTrabalho) {
filtered = filtered.filter(
(m) =>
m.title.toLowerCase().indexOf(this.searchTrabalho) ==
this.searchTrabalho.toLowerCase() > -1
);
}
if (this.select) {
filtered = filtered.filter(
(m) =>
m.title.toLowerCase().indexOf(this.select) ==
this.select.toLowerCase() > -1
);
}
return filtered;
},
},