mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[Improvement] Stepper blur (#1316)
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
:disabled="disabled || disableInput"
|
||||
@input="onInput"
|
||||
@keypress="onKeypress"
|
||||
@blur="onBlur"
|
||||
>
|
||||
<button
|
||||
:class="b('plus', { disabled: plusDisabled })"
|
||||
@@ -121,6 +122,14 @@ export default create({
|
||||
}
|
||||
},
|
||||
|
||||
onBlur(event) {
|
||||
if (!this.value) {
|
||||
this.currentValue = +this.min;
|
||||
this.emitInput();
|
||||
}
|
||||
this.$emit('blur', event);
|
||||
},
|
||||
|
||||
emitInput() {
|
||||
this.$emit('input', this.currentValue);
|
||||
this.$emit('change', this.currentValue);
|
||||
|
Reference in New Issue
Block a user