11<!-- app/components/Cart.vue-->
22<script setup>
3- const { cart , handleRemoveFromCart , removeFromCartButtonStatus , increment , decrement } = useCart ();
3+ const { cart , increment , decrement } = useCart ();
44const { order } = useCheckout ();
55 </script >
66
@@ -26,27 +26,26 @@ const { order } = useCheckout();
2626 <p class =" text-alizarin-crimson-700" >-{{ ((1 - product.variation.node.salePrice / product.variation.node.regularPrice) * 100).toFixed(0) }}%</p >
2727 </div >
2828 <div class =" text-xs flex gap-2 font-medium text-neutral-600 dark:text-neutral-300" >
29- <div >{{ $t('product.size') }}: {{ product.variation.attributes.map(attr => attr.value.toUpperCase()).join(', ') }} • {{ $t('product.quantity') }}:</div >
30- <div class =" flex items-center gap-1" >
31- <UIcon
32- name =" iconamoon:sign-minus-circle-fill"
33- size =" 14"
34- class =" text-black dark:text-white cursor-pointer"
35- @click =" decrement(product.variation.node.databaseId)" />
36- <span class =" text-center" >{{ product.quantity }}</span >
37- <UIcon
38- name =" iconamoon:sign-plus-circle-fill"
39- size =" 14"
40- class =" text-black dark:text-white cursor-pointer"
41- @click =" increment(product.variation.node.databaseId)" />
29+ <div >
30+ {{ $t('product.size') }}: {{ product.variation.attributes.map(attr => attr.value.toUpperCase()).join(', ') }} • {{ $t('product.quantity') }}:
31+ {{ product.quantity }}
4232 </div >
4333 </div >
4434 </div >
45- <button
46- @click =" handleRemoveFromCart(product.key)"
47- class =" absolute md:opacity-0 group-hover:opacity-100 top-2 right-2 md:-top-1 md:-right-1 transition bg-red-700 flex p-1 items-center justify-center rounded-full hover:bg-red-500 active:scale-95" >
48- <UIcon :name =" removeFromCartButtonStatus === 'remove' ? 'i-iconamoon-trash-light' : 'i-svg-spinners-90-ring-with-bg'" size =" 18" class =" text-white" />
49- </button >
35+ <div
36+ class =" absolute md:opacity-0 group-hover:opacity-100 top-2 right-2 md:-top-1 md:-right-1 transition space-y-0.5 flex flex-col p-0.5 bg-neutral-800 border border-white/5 items-center justify-center rounded-full" >
37+ <div class =" bg-white/10 hover:bg-white/30 transition-all rounded-full p-0.5 w-5 h-5 flex items-center justify-center" >
38+ <UIcon size =" 14" name =" i-iconamoon-sign-plus" class =" text-black dark:text-white cursor-pointer" @click =" increment(product.variation.node.databaseId)" />
39+ </div >
40+ <span class =" text-center text-sm" >{{ product.quantity }}</span >
41+ <div class =" bg-white/10 hover:bg-white/30 transition-all rounded-full p-0.5 w-5 h-5 flex items-center justify-center" >
42+ <UIcon
43+ size =" 14"
44+ :name =" product.quantity > 1 ? 'i-iconamoon-sign-minus' : 'i-iconamoon-trash-light'"
45+ class =" text-black dark:text-white cursor-pointer"
46+ @click =" decrement(product.variation.node.databaseId)" />
47+ </div >
48+ </div >
5049 </div >
5150 </div >
5251 </div >
0 commit comments