Store products in a basket, display list of products in basket

This commit is contained in:
2024-09-09 14:33:29 +02:00
parent 2d0dc274bf
commit 6ff577ece1
10 changed files with 161 additions and 45 deletions

View File

@@ -114,34 +114,36 @@ watch(() => onlyDiscounts.value, () => { filterProducts() })
</script>
<template>
<v-row>
<v-col>
<filter-bar
:number-of-items="filteredProducts.length"
:categories="categories"
:sort-by="sortBy"
v-model:selected-category="selectedCategory"
v-model:sorted-by="sortedBy"
v-model:only-discounts="onlyDiscounts"
/>
</v-col>
</v-row>
<v-row dense>
<v-col v-if="filteredProducts.length > 0" v-for="product in filteredProducts" cols="6" lg="4" xl="3">
<product-card
:product="product"
:category="getCategoryById(product.categoryId)"
@click="showProductDialog(product)"
/>
</v-col>
<v-col v-else>
<v-empty-state
icon="mdi-magnify"
headline="Keine Artikel gefunden"
/>
</v-col>
</v-row>
<v-container>
<v-row>
<v-col>
<filter-bar
:number-of-items="filteredProducts.length"
:categories="categories"
:sort-by="sortBy"
v-model:selected-category="selectedCategory"
v-model:sorted-by="sortedBy"
v-model:only-discounts="onlyDiscounts"
/>
</v-col>
</v-row>
<v-row dense>
<v-col v-if="filteredProducts.length > 0" v-for="product in filteredProducts" cols="12" sm="6" lg="4" xl="3">
<product-card
:product="product"
:category="getCategoryById(product.categoryId)"
@click="showProductDialog(product)"
/>
</v-col>
<v-col v-else>
<v-empty-state
icon="mdi-magnify"
headline="Keine Artikel gefunden"
/>
</v-col>
</v-row>
</v-container>
<product-details v-model="showProductDetails" :product="dialogProduct" :productCategory="getCategoryById(dialogProduct.categoryId)" />
</template>