mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[bugfix] Stepper: should convert value type (#1838)
This commit is contained in:
parent
696da2e30d
commit
5580379153
@ -86,14 +86,14 @@ VantComponent({
|
|||||||
this.triggerInput(value);
|
this.triggerInput(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
onChange(type) {
|
onChange(type: string) {
|
||||||
if (this.data[`${type}Disabled`]) {
|
if (this.data[`${type}Disabled`]) {
|
||||||
this.$emit('overlimit', type);
|
this.$emit('overlimit', type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const diff = type === 'minus' ? -this.data.step : +this.data.step;
|
const diff = type === 'minus' ? -this.data.step : +this.data.step;
|
||||||
const value = Math.round((this.data.value + diff) * 100) / 100;
|
const value = Math.round((+this.data.value + diff) * 100) / 100;
|
||||||
this.triggerInput(this.range(value));
|
this.triggerInput(this.range(value));
|
||||||
this.$emit(type);
|
this.$emit(type);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user