mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Sku): stepper value must be integer (#5202)
This commit is contained in:
parent
36086ff938
commit
31d645959d
@ -41,7 +41,8 @@ export default createComponent({
|
||||
|
||||
watch: {
|
||||
currentNum(num) {
|
||||
this.skuEventBus.$emit('sku:numChange', num);
|
||||
const intValue = parseInt(num, 10);
|
||||
this.skuEventBus.$emit('sku:numChange', intValue);
|
||||
},
|
||||
|
||||
stepperLimit(limit) {
|
||||
@ -122,9 +123,10 @@ export default createComponent({
|
||||
},
|
||||
|
||||
onChange(currentValue) {
|
||||
const intValue = parseInt(currentValue, 10);
|
||||
const { handleStepperChange } = this.customStepperConfig;
|
||||
handleStepperChange && handleStepperChange(currentValue);
|
||||
this.$emit('change', currentValue);
|
||||
handleStepperChange && handleStepperChange(intValue);
|
||||
this.$emit('change', intValue);
|
||||
},
|
||||
|
||||
checkState(min, max) {
|
||||
@ -159,6 +161,7 @@ export default createComponent({
|
||||
min={this.stepperMinLimit}
|
||||
max={this.stepperLimit}
|
||||
disableInput={this.disableStepperInput}
|
||||
integer
|
||||
onOverlimit={this.onOverLimit}
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user