-
Notifications
You must be signed in to change notification settings - Fork 129
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
Support for v-model #198
Comments
I think working in "vue-way" is a good approach and direction for I don't know Vue deep enough to implement that. But I am ok to review the Pull Request. There are just two events that you need to listen: Other attributes are changed via props. So, I don't think model of them is useful. |
Thanks for info. So I will try to find a moment for this and prepare this feature then. |
This is a great idea! any progress @chojnicki? |
Is there a way to use v-model with nodes props?
Let's say I have two inputs with X and Y coordinates, binded like this:
Problem is, this will of course only work one way. So when I change ref x/y rect will move, but when I move rect directly in Konva thank's to
draggable
, ref values will not update itself.In Konva default way to achieve this is dragend event:
Sure, it works, but it's annoying and with a lot of boilerplate when there are many props and nodes.
In Vue it's natural to use v-model for two-way binding, like so:
But this does not work. I checked component source and I cannot find anything responsible for sending events. So I guess it was never intended to work this way 😥
But this is Vue package, so I think it should support Vue way of coding. V-model support would be awesome, instead relying on standard JS/Konva DOM events.
I could try to make pull request, but problem is that I do not have much experience with Konva itself and because of that I'm not sure how to properly listen to node config changes made in Konva itself (if it's even possible) and then pass it to as vue events. Maybe it could listen to specific events like draggable, compare it to vue props and then send as v-model event.
Any thoughts?
The text was updated successfully, but these errors were encountered: