mirror of https://github.com/ElemeFE/element
input-number allow input '.' '-'
parent
409a3c852f
commit
3eb06dcb0e
|
@ -208,6 +208,15 @@
|
||||||
if (value === '') {
|
if (value === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (value.indexOf('.') === (value.length - 1)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.indexOf('-') === (value.length - 1)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const newVal = Number(value);
|
const newVal = Number(value);
|
||||||
if (!isNaN(newVal)) {
|
if (!isNaN(newVal)) {
|
||||||
this.setCurrentValue(newVal);
|
this.setCurrentValue(newVal);
|
||||||
|
|
Loading…
Reference in New Issue