-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Passing slots through in wrapper component #11478
Comments
I've achieved behavioral consistency among three variants by renaming second iteration element to something other than You are likely to be able to "tweak" your problem at hand by renaming the iteration variable: <template v-for="(_, name) in $scopedSlots" v-slot:[name]="slotData">
<slot :name="name" v-bind="slotData"/>
</template>
<template v-for="(_, someOtherName) in $slots" v-slot:[someOtherName]>
<slot :name="someOtherName"/>
</template> I'd dig deeper to find the underlying problem, but hope this tweak could help you meanwhile. Update: Following facts together lead to the inconsistency OP described:
Fact 1 and 2 causes second iteration in one I want to ping @yyx990803 here to ask for a comment on this. Whether it should be considered "working as intended" or as a bug? |
I think I'm running into a similar issue here in 2.6.12. Using the will not pass through when the parent stipulates: However, the first stipulation ( I've tried For now, I use @Nandiin's workaround of different names with $scopedSlots and $slots even though we really aren't supposed to use $slots anymore, at least not in 2.6.x |
Version
2.6.11
Reproduction link
https://codesandbox.io/s/romantic-mahavira-1s4v6
Steps to reproduce
See the content below "Wrapper"
What is expected?
All three variants, deprecated and new syntax in either order, should produce the same result
What is actually happening?
All produce different results. In the example the final 'new syntax' variant seems fine, but it doesn't work with Vuetify (not sure if this should be considered their issue ore Vue's)
Passing slots through to child components is, according to what you usually find on the net, done with this syntax:
Unfortunately this uses the slot and slot-scope attributes which are marked as deprecated.
As a current replacement, the following syntax seems to be the correct one:
Unfortunately this does not give the same result as the old syntax. Depending on the order in which scoped and non-scoped slots are passed, either scoped slots are not passed at all or non-scoped slots are only passed in $scopedSlots, which Vuetify (and maybe other libraries?) ignores for slots that are not supposed to be scoped.
The text was updated successfully, but these errors were encountered: