Basically I want to chain filters.
A search filter
A checkbox styled price filter with pre-defined values e.g < 10$ ,$20 -$50, $50+
A checkbox styled filter for selecting 'topics'
A select styled sort filter 'ascending, descending, highest and lowest price'
I have made a search filter which works but I cannot get my head around making all the filters work together.
I will be grateful for any help I get. :)
Thanks in advance.
JS
filteredSearch() {
return this.products.filter(p => p.topic.toLowerCase().match(this.search.toLowerCase()));
}
HTML
<div class="block" v-for="product in filteredSearch">
filtermethods.this.products.filter([search filter]).filter([checkbox filter]) ...Then implement a custom sort method that takes your sort filter into account.filteredSearch: function() { return this.products .filter(function(product) { return product.topic.toLowerCase().match(this.search.toLowerCase()) })I tried this, but it stopped working completely. What am I doing wrong?