mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 02:16:12 +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: {
|
watch: {
|
||||||
currentNum(num) {
|
currentNum(num) {
|
||||||
this.skuEventBus.$emit('sku:numChange', num);
|
const intValue = parseInt(num, 10);
|
||||||
|
this.skuEventBus.$emit('sku:numChange', intValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
stepperLimit(limit) {
|
stepperLimit(limit) {
|
||||||
@ -122,9 +123,10 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onChange(currentValue) {
|
onChange(currentValue) {
|
||||||
|
const intValue = parseInt(currentValue, 10);
|
||||||
const { handleStepperChange } = this.customStepperConfig;
|
const { handleStepperChange } = this.customStepperConfig;
|
||||||
handleStepperChange && handleStepperChange(currentValue);
|
handleStepperChange && handleStepperChange(intValue);
|
||||||
this.$emit('change', currentValue);
|
this.$emit('change', intValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
checkState(min, max) {
|
checkState(min, max) {
|
||||||
@ -159,6 +161,7 @@ export default createComponent({
|
|||||||
min={this.stepperMinLimit}
|
min={this.stepperMinLimit}
|
||||||
max={this.stepperLimit}
|
max={this.stepperLimit}
|
||||||
disableInput={this.disableStepperInput}
|
disableInput={this.disableStepperInput}
|
||||||
|
integer
|
||||||
onOverlimit={this.onOverLimit}
|
onOverlimit={this.onOverLimit}
|
||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
/>
|
/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user