fixed Input bug

when use input prop in Input, it can not correctly to emit a Number
value
This commit is contained in:
梁灏 2017-03-21 14:13:33 +08:00
parent bf9649f6e8
commit 85ed4df8fc

View file

@ -157,7 +157,8 @@
}
},
handleInput (event) {
const value = event.target.value;
let value = event.target.value;
if (this.number) value = Number.isNaN(Number(value)) ? value : Number(value);
this.$emit('input', value);
this.setCurrentValue(value);
this.$emit('on-change', event);