-
Notifications
You must be signed in to change notification settings - Fork 6
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
:model directive? #23
Comments
Yes, I see reasoning in r&d why
But if you prefer to have |
I wonder if my logic was incomplete, eg.
I may consider replacing |
looking at the code for If value were changed to reflect the behavior of
Rather, if writeonly was by default - then you could update the library in-place and it would be a nonbreaking change. |
Yes, I also had that in mind, binding value both ways. Either do it right away via :value or via :value.bind. The only question if user ever needs one-way value setter, so that changing input value doesn't affect state. |
I can't personally think of a case where id use a read-only :value - it seems like a :text or :html on any other kind of element would be more ideal for a case like that. I think :value.bind would also be fine ergonomics, if you are worried about existing pages getting undefined behavior. Either way seems okay to me. |
Ok, I just merged it, so must be fixed. |
I took a look at the branch last night but haven't had the chance to pull it into any projects yet. I'll let you know if anything breaks |
just checking in on this: value works totally as expected for me so far - was able to clean up a lot with it :) |
Hello there - Just starting to try out and get familiar with this framework. If I'm to understand, binding the content of any kind of input to a variable that can be shared in other elements currently uses an event listener, like so:
I'm curious if it's feasible or within your goals to have a more vue-style
v-model
directive for input fields, where the above has a bit more sugary syntax:Am I correct there isn't a directive directly like this in sprae already? If something like the first example is best-practice for what it does, it may be useful to have it as an example in the readme as well.
edit: Ah, I've just run into https://github.com/dy/sprae/blob/main/r%26d.md#x-value-is-confusing--also-uses-that---lets-skip-for-now-onchange-is-not-a-big-deal
It does seem fairly plausible to implement with the custom directives, though. I may look into writing one
The text was updated successfully, but these errors were encountered: