---修复数字输入组件无法正常输入负数和小数点问题
This commit is contained in:
@ -39,12 +39,13 @@ export class InputNumberModel {
|
|||||||
|
|
||||||
setViewValue(value: ValueType) {
|
setViewValue(value: ValueType) {
|
||||||
this.viewValue = value;
|
this.viewValue = value;
|
||||||
|
if(value!=undefined && (value+"").endsWith(".")) return;
|
||||||
this.modelValue = this.viewToModel(value);
|
this.modelValue = this.viewToModel(value);
|
||||||
this.triggerVm();
|
this.triggerVm();
|
||||||
}
|
}
|
||||||
|
|
||||||
viewToModel(vv: ValueType):ValueType {
|
viewToModel(vv: ValueType):ValueType {
|
||||||
if(vv==undefined) return;
|
if(vv==undefined || vv=="" || vv=="-") return;
|
||||||
if(!this.focus){
|
if(!this.focus){
|
||||||
this.viewValue = Number.format(Number.parse(vv),this.numberFormat);
|
this.viewValue = Number.format(Number.parse(vv),this.numberFormat);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user