add prop active-change
This commit is contained in:
parent
7adf94a291
commit
457d6c69fc
2 changed files with 10 additions and 2 deletions
|
@ -80,6 +80,10 @@
|
|||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
activeChange:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
value: {
|
||||
type: Number,
|
||||
default: 1
|
||||
|
@ -286,7 +290,7 @@
|
|||
},
|
||||
change (event) {
|
||||
|
||||
if (event.type == 'input') return;
|
||||
if (event.type == 'input' && !this.activeChange) return;
|
||||
let val = event.target.value.trim();
|
||||
if (this.parser) {
|
||||
val = this.parser(val);
|
||||
|
@ -297,7 +301,7 @@
|
|||
this.setValue(null);
|
||||
return;
|
||||
}
|
||||
//if (event.type == 'input' && val.match(/^\-?\.?$|\.$/)) return; // prevent fire early if decimal. If no more input the change event will fire later
|
||||
if (event.type == 'input' && val.match(/^\-?\.?$|\.$/)) return; // prevent fire early if decimal. If no more input the change event will fire later
|
||||
|
||||
val = Number(val);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue