File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div v-if =" isLoading" >
2
+ <div v-if =" isLoading && cartItems.length === 0 " >
3
3
<h2 class =" mt-64 text-3xl text-center" >Loading cart...</h2 >
4
4
</div >
5
- <div v-else-if =" error" >
5
+ <div v-else-if =" error && cartItems.length === 0 " >
6
6
<h2 class =" mt-64 text-3xl text-center text-red-500" >
7
7
Error loading cart. Please try again.
8
8
</h2 >
9
9
</div >
10
10
<div v-else-if =" cartItems.length" >
11
- <h1 class =" h-10 p-6 text-3xl font-bold text-center" >Cart</h1 >
12
- <section class =" mt-10" >
11
+ <h1 class =" h-10 p-6 text-3xl font-bold text-center" >
12
+ Cart
13
+ <span v-if =" isLoading" class =" text-sm text-gray-500 ml-2" >(updating...)</span >
14
+ </h1 >
15
+ <section class =" mt-10" :class =" { 'opacity-70': isLoading }" >
13
16
<CartItem
14
17
v-for =" product in cartItems"
15
18
:key =" product.key"
You can’t perform that action at this time.
0 commit comments