mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] Sku: add add-cart-text prop (#3725)
This commit is contained in:
parent
e7e015e9a4
commit
53e9468c2c
@ -124,6 +124,8 @@ export default {
|
||||
| hide-stock | Whether to hide stock | `Boolean` | `false` |
|
||||
| hide-quota-text | Whether to hide quota text | `Boolean` | `false` |
|
||||
| show-add-cart-btn | Whether to show cart button | `Boolean` | `true` |
|
||||
| buy-text | Buy button text | `String` | - | - |
|
||||
| add-cart-text | Add cart button text | `String` | - | - |
|
||||
| quota | Quota (0 as no limit) | `Number` | `0` |
|
||||
| quota-used | Used quota | `Number` | `0` |
|
||||
| reset-stepper-on-hide | Whether to reset stepper when hide | `Boolean` | `false` |
|
||||
|
@ -126,6 +126,8 @@ export default {
|
||||
| hide-stock | 是否显示商品剩余库存 | `Boolean` | `false` | - |
|
||||
| hide-quota-text | 是否显示限购提示 | `Boolean` | `false` | 1.4.8 |
|
||||
| show-add-cart-btn | 是否显示加入购物车按钮 | `Boolean` | `true` | - |
|
||||
| buy-text | 购买按钮文字 | `String` | `立即购买` | - |
|
||||
| add-cart-text | 加入购物车按钮文字 | `String` | `加入购物车` | - |
|
||||
| quota | 限购数,0 表示不限购 | `Number` | `0` | - |
|
||||
| quota-used | 已经购买过的数量 | `Number` | `0` | - |
|
||||
| reset-stepper-on-hide | 隐藏时重置选择的商品数量 | `Boolean` | `false` | - |
|
||||
|
@ -23,6 +23,7 @@ export default createComponent({
|
||||
quota: Number,
|
||||
value: Boolean,
|
||||
buyText: String,
|
||||
addCartText: String,
|
||||
quotaUsed: Number,
|
||||
goodsId: [Number, String],
|
||||
hideStock: Boolean,
|
||||
@ -453,6 +454,7 @@ export default createComponent({
|
||||
<SkuActions
|
||||
buyText={this.buyText}
|
||||
skuEventBus={skuEventBus}
|
||||
addCartText={this.addCartText}
|
||||
showAddCartBtn={this.showAddCartBtn}
|
||||
/>
|
||||
);
|
||||
|
@ -9,6 +9,7 @@ import { DefaultSlots } from '../../utils/types';
|
||||
export type SkuActionsProps = {
|
||||
buyText?: string;
|
||||
skuEventBus: Vue;
|
||||
addCartText?: string;
|
||||
showAddCartBtn?: boolean;
|
||||
};
|
||||
|
||||
@ -31,7 +32,7 @@ function SkuActions(
|
||||
square
|
||||
size="large"
|
||||
type="warning"
|
||||
text="加入购物车"
|
||||
text={props.addCartText || '加入购物车'}
|
||||
onClick={createEmitter('sku:addCart')}
|
||||
/>
|
||||
)}
|
||||
@ -48,6 +49,7 @@ function SkuActions(
|
||||
|
||||
SkuActions.props = {
|
||||
buyText: String,
|
||||
addCartText: String,
|
||||
skuEventBus: Object,
|
||||
showAddCartBtn: Boolean
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user