mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
fix(Stepper): should format value when max、min changed (#5257)
This commit is contained in:
@@ -114,6 +114,11 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
max: 'check',
|
||||
min: 'check',
|
||||
integer: 'check',
|
||||
decimalLength: 'check',
|
||||
|
||||
currentValue(val) {
|
||||
this.$emit('input', val);
|
||||
this.$emit('change', val, { name: this.name });
|
||||
@@ -121,6 +126,13 @@ export default createComponent({
|
||||
},
|
||||
|
||||
methods: {
|
||||
check() {
|
||||
const val = this.format(this.currentValue);
|
||||
if (!equal(val, this.currentValue)) {
|
||||
this.currentValue = val;
|
||||
}
|
||||
},
|
||||
|
||||
// filter illegal characters
|
||||
filter(value) {
|
||||
value = String(value).replace(/[^0-9.-]/g, '');
|
||||
|
Reference in New Issue
Block a user