Vue-next: Support passing down slots with v-bind like in 2.x

Created on 3 Jan 2020  路  6Comments  路  Source: vuejs/vue-next

What problem does this feature solve?

https://github.com/vuejs/vue/issues/7178

It seems like this still needs to be implemented, in v3 because currently it passes slots as component's prop instead of its children.

https://vue-next-template-explorer.netlify.com/#%7B%22src%22%3A%22%3Cchild%20v-bind%3D%5C%22%7B%20slots%3A%20%24slots%20%7D%5C%22%3E%3C%2Fchild%3E%22%2C%22options%22%3A%7B%22mode%22%3A%22module%22%2C%22prefixIdentifiers%22%3Afalse%2C%22hoistStatic%22%3Atrue%2C%22cacheHandlers%22%3Atrue%2C%22scopeId%22%3Anull%7D%7D

What does the proposed API look like?

<child v-bind="{ slots: $slots }"></child>
enhancement slots

Most helpful comment

I fully understand that :) I was just playing with the alpha today and noticed that this feature is not implemented so I thought I'd open a new issue and maybe someone with free time who would like to contribute to vue 3 can add this feature.

All 6 comments

@sqal - don't forget, VueJs 3 is still Alpha, it's far from finished and as far as I know, only contains what's needed to get it up to par with VueJs 3 (as it is a rewrite) - I'm also hoping for the implementation for this but I think we just have to wait for VueJs 3 to be finished

I fully understand that :) I was just playing with the alpha today and noticed that this feature is not implemented so I thought I'd open a new issue and maybe someone with free time who would like to contribute to vue 3 can add this feature.

Is this feature in progress? If not, I can try. @yyx990803

@ysj16 I'm not yet fully convinced that this is the best syntax to go with. I think a proper RFC with more discussion around the use case would be needed.

Is this feature in progress? If not, I can try. @yyx990803
@ysj16 If you have no time, I'll do it for you. hahah

@JasKang Come on!!

Was this page helpful?
0 / 5 - 0 ratings