I am currently working on a checkbox filter function that saves the value of clicked checkboxes in an array. However, I am encountering issues with updating the computed data as it is always returning undefined.
The structure of the data:
Casino { brand_tags { Brand_Tag_Name } }
Computed:
computed: {
filteredCasinos: function() {
return this.casinos.forEach(casino => {
return casino.brand_tags.filter(brandTag => {
return this.filteredCategories.includes(brandTag.Brand_Tag_Name)
})
})
}
},
HTML (It seems to be functioning correctly)
<label for="Featured">Featured Casinos
<input type="checkbox" v-model="filteredCategories" value="Featured">
</label>
<label for="Featured">Big Brands
<input type="checkbox" v-model="filteredCategories" value="Big Brand">
</label>
<label for="Featured">New Casinos
<input type="checkbox" v-model="filteredCategories" value="New Casino">
</label>
<label for="Featured">Pay n Play
<input type="checkbox" v-model="filteredCategories" value="Pay N Play">
</label>
<label for="Featured">Trusted Casinos
<input type="checkbox" v-model="filteredCategories" value="Trusted Casino">
</label>