[Improvement] Stepper blur (#1316)

This commit is contained in:
neverland
2018-06-22 15:46:51 +08:00
committed by GitHub
parent 6204892ad7
commit 1da6a30f19
4 changed files with 34 additions and 1 deletions

View File

@@ -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);