Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
<option v-for="item in info">
{{ item.fieldTypes.geo }}
</option>
fieldTypes.geo
are not unique, the options will also be repeated. Why is this? No need. We make a computed property that represents unique values and use it when creating options:computed: {
uniqueGeo() {
return [...new Set(this.info.map(n => n.fieldTypes.geo))];
},
...
<option v-for="n in uniqueGeo">{{ n }}</option>
computed: {
filteredOffers() {
const vacancy = this.searchVacancyName.toUpperCase();
const geo = this.searchGeo;
return this.info.filter(n => (
(!vacancy || n.fieldTypes.vacancyName.toUpperCase().includes(vacancy)) &&
(!geo || n.fieldTypes.geo === geo)
));
},
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question