vue-autoNumeric icon indicating copy to clipboard operation
vue-autoNumeric copied to clipboard

Directive usage

Open shrpne opened this issue 7 years ago • 3 comments

Thanks for this great project! I want to suggest a feature. Would be great if Autonumeric could be used as a directive. As I can see this Vue integration is pretty simple and component wrapper looks like an overhead to me.

shrpne avatar Aug 21 '18 14:08 shrpne

Hey @shrpne, my very first implementation of AutoNumeric within Vue was to use a directive, but somehow what I ended up with, although it worked great, was far too complex to my taste. You had to access the vnode info to retrieve the attached v-model name in order to prevent update loops, and so on...

That said, this is something we are open to, and If you have something in mind, please provide a PR so we can discuss how to integrate that !

AlexandreBonneau avatar Aug 21 '18 16:08 AlexandreBonneau

How about usage without v-model? Here is usage example of another mask Vue directive. I think it's okay to use the mask without v-model and it can be useful for someone.

shrpne avatar Aug 21 '18 22:08 shrpne

Well if you want to 'translate' the component to a directive, you are welcome to do so. Perhaps this could live in another project like vue-autoNumeric-directive?

AlexandreBonneau avatar Oct 13 '18 01:10 AlexandreBonneau