This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user