-
-
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
New (2.6 ) slot syntax results in slots not added to vm.$slots, breaking existing render functions #9421
New (2.6 ) slot syntax results in slots not added to vm.$slots, breaking existing render functions #9421
Comments
We were going to release a new minor version with $slots replaced by $scopedSlots, this change breaks v-slot (and slot-scope) use with dialog and menu activators |
The plan was 3 for vuetify 1.4/1.5, then release vuetify 1.6 with a minimum vue version of 2.6 so old templates would still work. Simple codepen demonstrating the problem: https://codepen.io/anon/pen/xMLreR?editors=1010 |
So I found this, which I guess works for those edge cases: https://codepen.io/anon/pen/BMddNv?editors=1010 |
@KaelWD This is now fixed in upstream Vue, and it seems your change actually makes things worse now :( |
Note: this has been reverted (exposing scoped slots on The original issue, however, is not since the new syntax is opt-in. Users can keep using the old syntax while waiting for libraries to properly migrate to use |
This is definitely an interesting problem, and one I don't really see a good solution for... I guess there's not much we can do now that this behavior is stable, except wait for the ecosystem to catch up :( |
In 0e8560d I've made it so that only slots using the new |
i made a simple test and v-slot still dont add the slots in $slots |
Version
2.6.1
Reproduction link
https://jsfiddle.net/3kpf9u54/4/
Steps to reproduce
<template>
displayed<template slot="content">
to<template #content>
or<template v-slot:content>
and observe the contents stop being displayedthis.$slots.content
tothis.$scopedSlots.content()
and observe the contents be displayed againWhat is expected?
Contents are displayed all the time; old render functions don't break when used with new syntax
What is actually happening?
New syntax forces slots into being scoped, breaking existing render functions
I'm actually not sure if this is intentional or not, but it breaks Vuetify, and probably other things too. Assuming this is intentional, it makes writing functional components more difficult, as you have to either:
this.$slots
(for Vue pre-2.6) andthis.$scopedSlots
(for Vue post-2.6)this.$scopedSlots
and ask Vue pre-2.6 users to addslot-scope
everywhere so all slots become scopedthis.$slots
and ask Vue post-2.6 users to use the legacy syntaxThe text was updated successfully, but these errors were encountered: