[bugfix] Stepper: change event error when clear input (#635)

This commit is contained in:
neverland 2018-02-11 17:01:15 +08:00 committed by GitHub
parent e0664d7f82
commit a2f0ebdf8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View File

@ -2,9 +2,9 @@
<div>
<van-nav-bar
v-show="title"
fixed
class="van-doc-nav-bar"
:title="title"
fixed
left-arrow
@click-left="onBack"
/>
@ -40,6 +40,7 @@ body {
.van-doc-nav-bar {
.van-nav-bar__title {
font-size: 15px;
text-transform: capitalize;
}
}

View File

@ -79,9 +79,11 @@ export default create({
watch: {
value(val) {
val = this.correctValue(+val);
if (val !== this.currentValue) {
this.currentValue = val;
if (val !== '') {
val = this.correctValue(+val);
if (val !== this.currentValue) {
this.currentValue = val;
}
}
}
},
@ -99,8 +101,8 @@ export default create({
},
onInput(event) {
const val = +event.target.value;
this.currentValue = this.correctValue(val);
const { value } = event.target;
this.currentValue = value ? this.correctValue(+value) : value;
this.emitInput();
},