20 lines
393 B
Vue
20 lines
393 B
Vue
<script setup lang="ts">
|
|
import CartItem from './CartItem.vue'
|
|
import {inject} from 'vue';
|
|
|
|
defineProps({
|
|
items: {
|
|
type: Array,
|
|
required: true,
|
|
},
|
|
})
|
|
|
|
const { toggleToCart } = inject('cart')
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex flex-col gap-4">
|
|
<CartItem v-for="item in items" :key="item.id" :item="item" @on-remove="toggleToCart" />
|
|
</div>
|
|
</template>
|