Template Local Variable Binding Proposal #12323
CorruptionTiger
started this conversation in
Ideas
Replies: 1 comment
-
see #7218 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Propose a new template syntax for creating local variable bindings with reactive references, similar to Vue's
v-slot
but more straightforward for simple variable aliasing.Motivation
When working with deeply nested reactive objects or when we want to create local aliases for reactive data, current solutions either require script setup variables or slot syntax. A more direct syntax in template could improve code readability and reduce boilerplate.
Proposed Syntax
Example Usage
Benefits
Current Alternatives
Currently, developers need to either:
Questions for Discussion
Looking forward to the community's thoughts and feedback on this proposal.
Beta Was this translation helpful? Give feedback.
All reactions