fix(Sku): stepper value must be integer (#5202)

This commit is contained in:
Waiter 2019-12-05 19:30:06 +08:00 committed by neverland
parent 36086ff938
commit 31d645959d

View File

@ -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}
/>