mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] Sku: add stepper-change event (#1349)
This commit is contained in:
parent
7d97a2fd85
commit
0b94e8cecd
@ -77,6 +77,7 @@
|
|||||||
:disable-stepper-input="disableStepperInput"
|
:disable-stepper-input="disableStepperInput"
|
||||||
:hide-stock="hideStock"
|
:hide-stock="hideStock"
|
||||||
:custom-stepper-config="customStepperConfig"
|
:custom-stepper-config="customStepperConfig"
|
||||||
|
@change="$emit('stepper-change', $event)"
|
||||||
/>
|
/>
|
||||||
</slot>
|
</slot>
|
||||||
<!-- sku-messages -->
|
<!-- sku-messages -->
|
||||||
|
@ -121,6 +121,7 @@ export default create({
|
|||||||
onChange(currentValue) {
|
onChange(currentValue) {
|
||||||
const { handleStepperChange } = this.customStepperConfig;
|
const { handleStepperChange } = this.customStepperConfig;
|
||||||
handleStepperChange && handleStepperChange(currentValue);
|
handleStepperChange && handleStepperChange(currentValue);
|
||||||
|
this.$emit('change', currentValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -108,6 +108,8 @@ Vue.use(Sku);
|
|||||||
|-----------|-----------|-----------|
|
|-----------|-----------|-----------|
|
||||||
| add-cart | Triggered when click cart button | data: Object |
|
| add-cart | Triggered when click cart button | data: Object |
|
||||||
| buy-clicked | Triggered when click buy button | data: Object |
|
| buy-clicked | Triggered when click buy button | data: Object |
|
||||||
|
| stepper-change | Triggered when stepper value changed | value: number |
|
||||||
|
|
||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@ Vue.use(Sku);
|
|||||||
|-----------|-----------|-----------|
|
|-----------|-----------|-----------|
|
||||||
| add-cart | 点击添加购物车回调 | skuData: Object |
|
| add-cart | 点击添加购物车回调 | skuData: Object |
|
||||||
| buy-clicked | 点击购买回调 | skuData: Object |
|
| buy-clicked | 点击购买回调 | skuData: Object |
|
||||||
|
| stepper-change | 购买数量变化时触发 | value: number |
|
||||||
|
|
||||||
### 方法
|
### 方法
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user