add prop active-change
This commit is contained in:
parent
7adf94a291
commit
457d6c69fc
2 changed files with 10 additions and 2 deletions
|
@ -56,6 +56,10 @@
|
|||
|
||||
<InputNumber v-model="valueNull" style="width: 200px" :min='1' :max='10000' :precision='2' ></InputNumber>
|
||||
<InputNumber v-model="valueNull" style="width: 200px" ></InputNumber>
|
||||
<div style="margin:10px 0px">
|
||||
<InputNumber :activeChange="false" v-model="valueNull" style="width: 200px" :min='1' :max='10000' :precision='2' ></InputNumber>
|
||||
<InputNumber :activeChange="false" v-model="valueNull" style="width: 200px" ></InputNumber>
|
||||
</div>
|
||||
<div style="margin:10px 0px">
|
||||
<InputNumber
|
||||
:max="10000"
|
||||
|
|
|
@ -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
Reference in a new issue