mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-05-22 06:31:46 +08:00
fix(Stepper): watch max and min (#2528)
This commit is contained in:
parent
72e0556441
commit
91ec25ea40
@ -62,7 +62,9 @@ VantComponent({
|
|||||||
if (typeof newValue === 'number' && +this.data.value !== newValue) {
|
if (typeof newValue === 'number' && +this.data.value !== newValue) {
|
||||||
this.set({ value: newValue });
|
this.set({ value: newValue });
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
max: 'check',
|
||||||
|
min: 'check',
|
||||||
},
|
},
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
@ -76,6 +78,13 @@ VantComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
check() {
|
||||||
|
const newValue = this.range(this.data.value);
|
||||||
|
if (typeof newValue === 'number' && +this.data.value !== newValue) {
|
||||||
|
this.set({ value: newValue });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onFocus(event: Weapp.Event) {
|
onFocus(event: Weapp.Event) {
|
||||||
this.$emit('focus', event.detail);
|
this.$emit('focus', event.detail);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user