I have an array
with cars like this:
[
{"name" : "Audi"},
{"name" : "BMW"},
{"name" : "Mercedes"},
{"name" : "VW"},
{"name" : "Fiat"},
{"name" : "Hyundai"},
{"name" : "Opel"},
...and many many more
]
now I have an input field, where users can search for their desired car but I want to include some auto-suggest. So far I have made this
<input type="text" @input="filterCars" v-model="search" />
filterSkills() {
this.filterCars = this.cars.filter(car => {
return car.name.toLowerCase().includes(this.search.toLowerCase());
});
}
which actually works fine, but I want to make the matching results appear, after the user has entered 3 characters - for example, when I type 'Aud' - Audi will appear as suggestion - how can I do that?