Saturday 12 December 2020

Element UI Number Input emit value only on blur event

this is my minimal working example:

https://codepen.io/peter-peter-the-typescripter/pen/WNGxWEB


<el-input-number placeholder="Please input" :value="input" @input="onInput" />

onInput(val) {
  console.log('input', val)
  this.input = val
  this.$emit('input', val)
}

Can you tell me how to edit this code to emit and validate value almost immediately after I finish typing? This is version 2.x of element UI which we are currently using in project. In previous version 1.x this input was emitted value on change with little delay (few ms), now you need to leave the focus on input.

Is possible to create similar behaviour what we had in version 1.x? Check it here: https://element.eleme.io/1.4/#/en-US/component/input-number

Thank you.



from Element UI Number Input emit value only on blur event

No comments:

Post a Comment