mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-13 11:34:02 +08:00
input-number allow input '.' '-'
This commit is contained in:
@@ -208,6 +208,15 @@
|
||||
if (value === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.indexOf('.') === (value.length - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.indexOf('-') === (value.length - 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const newVal = Number(value);
|
||||
if (!isNaN(newVal)) {
|
||||
this.setCurrentValue(newVal);
|
||||
|
||||
Reference in New Issue
Block a user