WOW, COOL thanks !
SO just to be sure:
if the “user” want to filter for a
“phone”, “samsung”, “Android” :Then the filter will not find that?
let shopList = new Vue({
el: '#shoplist',
data: {
currency,
itemList, //Cykeltur comment: The list with all the items...
selectedCategory: [] //Cykeltur comment: a array of selections
},
computed: {
filteredCategory() {
return itemList.filter(item => { //Cykeltur comment: returning a list of the products that match a criteria
if (item.category.match(this.selectedCategory)) return item.category.indexOf(this.selectedCategory) > -1; //Cykeltur comment: returning this if true and stop the if statement
else if (item.brand.match(this.selectedCategory)) return item.brand.indexOf(this.selectedCategory) > -1; //Cykeltur comment: returning this if true and stop the if statement
else if (item.os.match(this.selectedCategory)) return item.os.indexOf(this.selectedCategory) > -1; //Cykeltur comment: returning this if true and stop the if statement
return;
})
}
}
})
or do i misunderstand the filter?