<div>
<q-card
v-for="box in boxes"
:key="box.id">
<q-item>
<q-item-section>
<span> {{ box.name }} </span>
</q-item-section>
</q-item>
<q-list>
<q-item
v-for="tool in box.tools"
:key="tool.id"
clickable
</q-item>
<q-item-section>
<span> {{ tool.name }} </span>
</q-item-section>
</q-list>
</q-card>
</div>
Form input filter value
inputFilterValue = "box A"
Filter boxes
Edited with return.
computed: {
boxes(){
return boxes.filter(box => {
return box.name.toLowerCase().match(inputFilterValue.toLowerCase())
});
}
}
This solution is effective
Is there a way to apply the same filtering logic to nested v-for loop on box-tools list?
UPDATE:
CODEPEN: https://codepen.io/ijose/pen/NWyoRMX