Browse Source

fix: card新增props

Drjnigfubo 3 years ago
parent
commit
47cce19fa9

+ 1 - 0
src/packages/__VUE/card/doc.md

@@ -155,6 +155,7 @@ app.use(Card);
 | shop-desc  | 店铺介绍                                  | String | -    |
 | shop-desc  | 店铺介绍                                  | String | -    |
 | delivery     | 配送方式 | String  | -      |
 | delivery     | 配送方式 | String  | -      |
 | shop-name   | 店铺名称| String  | -      |
 | shop-name   | 店铺名称| String  | -      |
+| is-need-price  | 是否需要价格展示| Boolean  | true   |
 
 
 
 
 ### Slots
 ### Slots

+ 5 - 1
src/packages/__VUE/card/index.taro.vue

@@ -6,7 +6,7 @@
     <div class="nut-card__right">
     <div class="nut-card__right">
       <div class="nut-card__right__title">{{ title }}</div>
       <div class="nut-card__right__title">{{ title }}</div>
       <slot name="prolist"></slot>
       <slot name="prolist"></slot>
-      <div class="nut-card__right__price">
+      <div class="nut-card__right__price" v-if="isNeedPrice">
         <nut-price :price="price"></nut-price>
         <nut-price :price="price"></nut-price>
         <template v-if="isHaveSlot('origin')">
         <template v-if="isHaveSlot('origin')">
           <slot name="origin"></slot>
           <slot name="origin"></slot>
@@ -66,6 +66,10 @@ export default create({
     shopName: {
     shopName: {
       type: String,
       type: String,
       default: ''
       default: ''
+    },
+    isNeedPrice: {
+      type: Boolean,
+      default: true
     }
     }
   },
   },
 
 

+ 5 - 1
src/packages/__VUE/card/index.vue

@@ -6,7 +6,7 @@
     <div class="nut-card__right">
     <div class="nut-card__right">
       <div class="nut-card__right__title">{{ title }}</div>
       <div class="nut-card__right__title">{{ title }}</div>
       <slot name="prolist"></slot>
       <slot name="prolist"></slot>
-      <div class="nut-card__right__price">
+      <div class="nut-card__right__price" v-if="isNeedPrice">
         <nut-price :price="price"></nut-price>
         <nut-price :price="price"></nut-price>
         <template v-if="isHaveSlot('origin')">
         <template v-if="isHaveSlot('origin')">
           <slot name="origin"></slot>
           <slot name="origin"></slot>
@@ -63,6 +63,10 @@ export default create({
     shopName: {
     shopName: {
       type: String,
       type: String,
       default: ''
       default: ''
+    },
+    isNeedPrice: {
+      type: Boolean,
+      default: true
     }
     }
   },
   },