33 <h2 class =" mt-64 text-3xl text-center" >Loading cart...</h2 >
44 </div >
55 <div v-else-if =" error" >
6- <h2 class =" mt-64 text-3xl text-center text-red-500" >Error loading cart. Please try again.</h2 >
6+ <h2 class =" mt-64 text-3xl text-center text-red-500" >
7+ Error loading cart. Please try again.
8+ </h2 >
79 </div >
810 <div v-else-if =" cartItems.length" >
911 <h1 class =" h-10 p-6 text-3xl font-bold text-center" >Cart</h1 >
2931 * @module CartContents
3032 * @returns {Object} The Vue.js component object.
3133 */
32- import { computed , ref , onMounted } from ' vue' ;
34+ import { computed , ref , onMounted } from " vue" ;
3335import { useCart } from " @/store/useCart" ;
34- import CommonButton from ' @/components/common/CommonButton.vue' ;
36+ import CommonButton from " @/components/common/CommonButton.vue" ;
3537
3638const props = defineProps ({
3739 showCheckoutButton: {
3840 type: Boolean ,
39- default: false
40- }
41+ default: false ,
42+ },
4143});
4244
4345const cart = useCart ();
@@ -55,7 +57,7 @@ const handleRemoveProduct = async (key) => {
5557 try {
5658 await cart .removeProductFromCart (key);
5759 } catch (error) {
58- console .error (' Error removing product from cart:' , error);
60+ console .error (" Error removing product from cart:" , error);
5961 // Optionally, you can add a user-friendly notification here
6062 // without exposing the error details
6163 }
@@ -65,7 +67,7 @@ onMounted(async () => {
6567 try {
6668 await cart .refetch ();
6769 } catch (err) {
68- console .error (' Error fetching cart:' , err);
70+ console .error (" Error fetching cart:" , err);
6971 error .value = err;
7072 } finally {
7173 isLoading .value = false ;
0 commit comments