update
This commit is contained in:
parent
c020a58d9e
commit
7adf94a291
2 changed files with 30 additions and 12 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue