File tree Expand file tree Collapse file tree
src/views/home/product-show Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 <div class =" card" @click =" handleView" >
33 <div class =" thumb" >
44 <img :src =" product.imageUrlUrl" :alt =" product.name" />
5- <div v-if =" product.amount === 0" class =" badge" >缺货</div >
5+ <div class =" badges" >
6+ <div v-if =" product.amount === 0" class =" badge" >缺货</div >
7+ <div v-if =" product.status !== '0'" class =" badge" >已下架</div >
8+ </div >
69 </div >
710 <div class =" body" >
811 <div class =" title" :title =" product.name" >{{ product.name }}</div >
@@ -61,10 +64,19 @@ const handleView = () => emit('view')
6164 object-fit : cover ;
6265 display : block ;
6366}
64- .badge {
67+ .badges {
6568 position : absolute ;
6669 top : 8px ;
6770 left : 8px ;
71+ z-index : 1 ;
72+ display : flex ;
73+ flex-direction : column ;
74+ align-items : flex-start ;
75+ gap : 6px ;
76+ }
77+ .badge {
78+ display : inline-flex ;
79+ width : fit-content ;
6880 background : #f56c6c ;
6981 color : #fff ;
7082 padding : 4px 8px ;
You can’t perform that action at this time.
0 commit comments