diff --git a/src/components/inputnumber/InputNumber.vue b/src/components/inputnumber/InputNumber.vue index 3f935a34dd..abe0e649e9 100755 --- a/src/components/inputnumber/InputNumber.vue +++ b/src/components/inputnumber/InputNumber.vue @@ -165,6 +165,10 @@ export default { }, formatValue(value) { if (value != null) { + if (value === '-') { // Minus sign + return value; + } + if (this.format) { let formatter = new Intl.NumberFormat(this.locale, this.getOptions()); let formattedValue = formatter.format(value); @@ -196,6 +200,9 @@ export default { .replace(this._numeral, this._index); if (filteredText) { + if (filteredText === '-') // Minus sign + return filteredText; + let parsedValue = +filteredText; return isNaN(parsedValue) ? null : parsedValue; }