product-card
Some checks failed
Deploy / build-and-deploy (push) Failing after 9s

This commit is contained in:
Veselov
2025-09-21 01:27:48 +03:00
parent e2ebf54d56
commit 9b42223a97
10 changed files with 99 additions and 4 deletions

View File

@@ -34,7 +34,13 @@
</div>
</div>
<UButton class="justify-content-center" label="Добавить в корзину" size="xl" />
<UButton
:disabled="!currentSize"
class="justify-content-center"
label="Добавить в корзину"
size="xl"
@click="addToCartBtn"
/>
<UAccordion :items="items" />
</div>
@@ -45,11 +51,12 @@ import ProductVariations from '~/components/ProductVariations.vue'
import { useCurrentProduct, useProduct } from '~/composables'
const { t } = useI18n()
const { addToCart } = useCart()
const { productsData, colors, getAttribute } = useProduct()
const { currentVariant, currentColor, currentMaterial } = useCurrentProduct()
const currentSize = ref(0)
const currentSize = ref(undefined)
const items = computed(() => [
{
@@ -78,6 +85,10 @@ const items = computed(() => [
content: 'Возврат в течение 14 дней\nОбмен размера в течение 7 дней',
},
])
function addToCartBtn() {
addToCart(currentSize?.value?.id)
}
</script>
<style lang="scss">