-
-
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
Scoped slot does not work with dynamic slot name #4779
Comments
Hi @smolinari Thanks for your report, almost perfect :) The only thing missing would be a small reproduction on jsfiddle.net or a similar service. Could you add one? Then we can look into it. Also, in the failing example, the Thanks! |
Hey @LinusBorg Thorsten, I'll see if I can put together a jsfiddle. The missing closing Scott |
Jsfiddles Double named slots: https://jsfiddle.net/mwLbw11k/369/ <- works The mix: https://jsfiddle.net/mwLbw11k/371/ <- doesn't work. Interesting that jsfiddle at least renders the results. However, the dynamic slots don't work. Scott |
Thanks for the quick resolution!! 👍 This kind of service is another reason why I know Vue is a great choice! Scott |
I'll admit I might be in left field with this, as it has been a learning experience, but it seems like either a bug or an enhancement. Go gently with me. 😄
You can see more discussion here as to why I've even come up to this point: https://forum.vuejs.org/t/missing-basic-understanding-between-slots-and-templates/5503/3
Steps to reproduce
If you have a double named slot situation, the scope feature works fine. i.e.:
Parent
Child
You will get:
If you also have a "dynamic" slotting going, where you'd like to control the order of certain HTML blocks and without scopes, this works fine too.
Parent
Child
You will get:
What is Expected?
If you mix the two together. Dynamic slotting with child scopes,
Parent
Child
Vue should at least render something, possibly even an error, if this isn't feasible.
What is actually happening?
Vue delivers a blank page and no errors.
Jsfiddles
Double named slots: https://jsfiddle.net/mwLbw11k/369/ <- works
Dynamic slots: https://jsfiddle.net/mwLbw11k/370/ <- works, when you change switchedto true, the slots change places.
The mix: https://jsfiddle.net/mwLbw11k/371/ <- doesn't work
Interesting that jsfiddle at least renders the results. However, the dynamic slots don't work.
Like I said, go easy with me. 😄
Scott
The text was updated successfully, but these errors were encountered: