Supporting muliple refs #589
thiagomajesk
started this conversation in
4. General
Replies: 2 comments 6 replies
-
I'm not a fan of the |
Beta Was this translation helpful? Give feedback.
1 reply
-
I think some real world examples (codepens?) where this is needed would help Caleb make a decision. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello guys!
I wanted to restart this discussion because I think it could be nice to have more ways to reference elements in Alpine. This is a continuation on top of this issue where I proposed a new option for the
x-ref
API.The new option would allow the user to specify a named
x-ref
. This would allow multiple refs to be grouped in the same placed and referenced later on. For example:And a shorter syntax:
I know that the
x-ref
attribute is probably going to change in the next version. But even if that happens, I'd like to discuss the possibility of having at least some kind of syntax that enables this workflow. A common workflow for submitting array values in forms without breaking the "native" API is:PS.: Notice that I'm not talking about keeping state of refs. Since those are evaluated at runtime, the only thing that must be done is grouping them together (the implications was made a little bit more clear in the previous issue).
Beta Was this translation helpful? Give feedback.
All reactions