This commit is contained in:
huanghong 2018-08-28 12:06:18 +08:00
parent c020a58d9e
commit 7adf94a291
2 changed files with 30 additions and 12 deletions

View file

@ -250,13 +250,16 @@
setValue (val) {
// step precision
if (val && !isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
const {min, max} = this;
if (val > max) {
val = max;
} else if (val < min) {
val = min;
}
if (val!==null) {
if (val > max) {
val = max;
} else if (val < min) {
val = min;
}
}
this.$nextTick(() => {
this.currentValue = val;
this.$emit('input', val);
@ -282,6 +285,7 @@
}
},
change (event) {
if (event.type == 'input') return;
let val = event.target.value.trim();
if (this.parser) {