feat: select category

This commit is contained in:
Vlad Stan 2023-07-14 10:36:49 +03:00
parent 79ce34467c
commit 22e32c9513
2 changed files with 21 additions and 6 deletions

View file

@ -213,9 +213,10 @@
<div v-if="products?.length" class="gt-sm">
<q-virtual-scroll :items="allCategories" virtual-scroll-horizontal>
<template v-slot="{ item, index }">
<q-chip :key="index" class="cursor-pointer q-mb-md">
<span v-text="item.category"></span>
<q-badge rounded class="q-ml-sm" color="secondary"> <span v-text="item.count"></span></q-badge>
<q-chip :key="index" :color="item.selected ? 'grey': ''" class="cursor-pointer q-mb-md">
<span v-text="item.category" @click="toggleCategoryFilter(item.category)"></span>
<q-badge @click="toggleCategoryFilter(item.category)" rounded class="q-ml-sm" color="secondary"> <span
v-text="item.count"></span></q-badge>
</q-chip>
</template>
</q-virtual-scroll>