-
-
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
Regular slot and scoped slot with same name shouldn't be allowed #10149
Comments
You cannot name a scoped slot and a regular slot the same way |
I really recommend adding this warning in docs. as I read the docs, I don't realize this may be a problem for me. |
I think it`s correct.In a way, a regular slot is a socped slot,only the context is underfined, the same name solt is can used by twice times. Maybe the user want to do like this. |
Not really because we want to merge slots and scoped slots (v-slot is there for that too) so we want to disallow that behavior
Eduardo San Martin Morote
… On 20 Jun 2019, at 00:52, likui ***@***.***> wrote:
I think it`s correct.In a way, a regular slot is a socped slot,only the context is underfined, the same name solt is can used by twice times. Maybe the user want to do like this.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@posva I will work it. |
We tried to solve this issue with a small group, but we were unable to reproduce it in Vue 3. In the docs for Vue 3 this seems to be using a different approach. We are unsure if this issue is still relevant for Vue 3. @kerm1it Does your commit fix the issue? If yes, are you planning on turning this into a PR? Could you please let us know if this is still an issue? If so, we'd like to help find a solution. If not, it might be worth it to close this issue. |
Version
2.6.10
Reproduction link
https://codepen.io/lee88688/pen/jjPpBm?editors=1010
Steps to reproduce
as seen in codepen, "hello" component have only one slot. but rendered 2 div tag at last. I have a look at Vue's code renderSlot which seems renderSlot function would treat the normal slot as scoped slot. why it would be like this?
the following code is render function of hello component which is compiled by Vue.compile. _t is renderSlot function. when normal slot and scoped slot in same component the problem above will be present.
What is expected?
render just one slot.
What is actually happening?
render one slot twice.
The text was updated successfully, but these errors were encountered: