vue-autoNumeric
vue-autoNumeric copied to clipboard
Ignoring the .lazy modifier
Hello. Thanks for the great component!
I have identified one issue, though.
When using the .lazy modifier on v-model, the AutoNumeric component updates the model on the input event, rather than on the change event.
I have created a fiddle to illustrate the issue in which there is a standard input next to a Vue AutoNumeric component: https://jsfiddle.net/p462eLa9/1/
Please let me know your thoughts on this.
You are correct, I totally overlooked that modifier!
@AlexandreBonneau I'm glad I could help. Are you planning to release an update in the near future that would include the fix to this issue? Thanks.
Yes, but it depends on your definition of 'near future' really :) I'm pretty swamped for a few months now, so I'll see when I can get a closer look into that issue.
If you find the solution on your end, please feel free to create a PR!
@AlexandreBonneau
I've done some digging around and I don't think it's possible without this: https://github.com/vuejs/vue/issues/6914
Same issue. @AlexandreBonneau, have you planned to fix the issue? @cristian-frumusanu , have you get a workaround?
Same issue. @AlexandreBonneau, have you planned to fix the issue? @cristian-frumusanu , have you get a workaround?
@doucouredave
I think this works:
<VueAutonumeric @change.native="(event) => { yourVariable = event.target.value }" />
Thanks for you reply @cristian-frumusanu,
what does mean yourVariable? is it v-model?
@doucouredave
yourVariable is just the variable name. It could be foo, bar, whatever.
So, if you would normally have
<VueAutonumeric v-model="yourVariable" />
to make this work you have to write:
<VueAutonumeric @change.native="(event) => { yourVariable = event.target.value }" />
I was seeing a warning from AutoNumeric about the model being undefined. So I added :value="model" to ^^