From f59beb9787616ca2ce4de558c9dfbb129858dfcf Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 26 Nov 2019 19:19:41 +0800 Subject: [PATCH] feat(Card): allow use bottom slot without price or num (#5116) --- src/card/index.tsx | 2 +- src/card/test/__snapshots__/index.spec.js.snap | 4 +--- src/card/test/index.spec.js | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/card/index.tsx b/src/card/index.tsx index c671dcfce..17e981e0d 100644 --- a/src/card/index.tsx +++ b/src/card/index.tsx @@ -51,7 +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 showBottom = showNum || showPrice || showOriginPrice || slots.bottom; function onThumbClick(event: MouseEvent) { emit(ctx, 'click-thumb', event); diff --git a/src/card/test/__snapshots__/index.spec.js.snap b/src/card/test/__snapshots__/index.spec.js.snap index 091a7af08..d4de2d22d 100644 --- a/src/card/test/__snapshots__/index.spec.js.snap +++ b/src/card/test/__snapshots__/index.spec.js.snap @@ -4,9 +4,7 @@ exports[`render bottom slot 1`] = `
-
-
¥ 100
Custom Bottom -
+
Custom Bottom
diff --git a/src/card/test/index.spec.js b/src/card/test/index.spec.js index bbcea88cb..fcef9663e 100644 --- a/src/card/test/index.spec.js +++ b/src/card/test/index.spec.js @@ -65,9 +65,6 @@ test('render origin-price slot', () => { test('render bottom slot', () => { const wrapper = mount(Card, { - propsData: { - price: 100 - }, scopedSlots: { bottom: () => 'Custom Bottom' }