Vue directive to update input on blur
You need to trigger the input
event to let Vue know that value was changed.
Do this once you've detected that input value is different than current value (to avoid infinit recursion)
if (el.value && el.value !== el.value.trim()) { el.value = el.value.trim(); el.dispatchEvent(new Event('input'));}
Refer this:https://stackoverflow.com/a/49602559/1364747
- Try the 'input' event
- Try the bind method and vnode if above doesn't work