-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Pass arbitrary properties to slot #5456
Comments
I have wished for this as well... |
Similarly, it could be useful to have a catch-all for the <Component let:$$lets>
<slot {...$$lets} />
</Component> |
Version 3.30.0 now lets you use spread props in slots: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I have run into cases where it would be nice to be able to pass arbitrary props to a slot, similar to the ability to spread the $$props global over a regular component.
A specific use case was having a generic link wrapper that would wrap any arbitrary components, which would require passing through all properties without knowing what could be present. The consuming component would know what would be present, but not the wrapper itself.
Trying to spread properties over a slot results in a
<slot> cannot have directives
errorDescribe the solution you'd like
I would like to see a way to pass through arbitrary properties to slot components. The first idea that comes to mind is allowing the spreading of props over a slot.
Describe alternatives you've considered
As an alternative I have written component specific wrappers rather than generic wrappers.
How important is this feature to you?
It's more of a nicety than a necessity, but I have encountered situations where this would have been handy on more than one occasion.
The text was updated successfully, but these errors were encountered: