diff --git a/packages/card/index.tsx b/packages/card/index.tsx index ebc3f5b10..9d4546896 100644 --- a/packages/card/index.tsx +++ b/packages/card/index.tsx @@ -51,6 +51,7 @@ function Card( const showNum = slots.num || isDef(props.num); const showPrice = slots.price || isDef(props.price); const showOriginPrice = slots['origin-price'] || isDef(props.originPrice); + const showBottom = showNum || showPrice || showOriginPrice; const Thumb = showThumb && ( @@ -81,9 +82,7 @@ function Card( const Desc = slots.desc ? slots.desc() - : props.desc && ( -
{props.desc}
- ); + : props.desc &&
{props.desc}
; const Price = showPrice && (
@@ -103,9 +102,7 @@ function Card(
{slots.num ? slots.num() : `x ${props.num}`}
); - const Footer = slots.footer && ( -
{slots.footer()}
- ); + const Footer = slots.footer &&
{slots.footer()}
; return (
@@ -115,11 +112,13 @@ function Card( {Title} {Desc} {slots.tags && slots.tags()} -
- {Price} - {OriginPrice} - {Num} -
+ {showBottom && ( +
+ {Price} + {OriginPrice} + {Num} +
+ )}
{Footer}