I have a product search page with filters based on selected Category.
Depending on selected category by user I get following response from api
"customFields":{
"select":{
"brand":{"options":[ "nike", "adidas","puma"]},
"colour":{"options":["black","grey","white"]
},
"range":{
"price":{"options":["0","100","1000"]
}
}
Select
fields are checkboxes where user can select more than one option to search and
Range
where user selects min and max. So 2 dropdowns, one for minimum and second for maximum.
I have created checkboxes like following
<div class="form-row" v-for="(selectField, index) in selectCustomFields">
<div class="overflow-auto options-list" v-for="(value, name) in selectField.options">
<label class="custom-control custom-checkbox mb-3">
<input type="checkbox" class="custom-control-input" v-model="index" :value="value" @click="onChange($event)">
<span class="custom-control-label">
<span class="text-dark">{{ value }}</span>
</span>
</label>
</div>
</div>
How can I get the value of all checked options of termQualities
?
How can I create checkbox array so that I can get all selected values?
I am trying to achieve something like this with the only difference that sidebar filters are changed depending on the product category.
Thank you