Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directive usage #23

Open
shrpne opened this issue Aug 21, 2018 · 3 comments
Open

Directive usage #23

shrpne opened this issue Aug 21, 2018 · 3 comments

Comments

@shrpne
Copy link
Contributor

shrpne commented Aug 21, 2018

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.

@AlexandreBonneau
Copy link
Member

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 !

@shrpne
Copy link
Contributor Author

shrpne commented Aug 21, 2018

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.

@AlexandreBonneau
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants