-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Dynamic slot name bound from v-for directive not working with scoped slots #5615
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
Comments
Not sure how to label it so, labelling it as improvement and bug |
@posva @sparamasivan Am I missing something? There are two root elements in the parent compoent, so an error is reported. Vue.component('parent', {
template: '' +
'<child>' +
'<template :slot="test" scope="props">' +
'<p>{{props.text}}</p>' +
'</template>' +
'</child>' +
'<child>' +
'<template v-for="slotName in slotNames" :slot="slotName" scope="props">' +
'<p>{{props.text}}</p>' +
'</template>' +
'</child>',
data: function () {
return {
slotNames: ["test", "test1", "test2"],
test: 'test'
}
}
}); |
@defcc Oh, sorry, I forgot to update the repro, yeah, it's wrong, but adding a single root element still showcases the problem (https://jsfiddle.net/frctmhLd/3/) |
I also updated the demo here. https://jsfiddle.net/frctmhLd/4/ Seems to be a bug with scoped slots. |
Thank you folks for fixing this. |
Uh oh!
There was an error while loading. Please reload this page.
Version
2.3.2
Reproduction link
https://jsfiddle.net/frctmhLd/3/
Steps to reproduce
Create a scoped slot using the element, as is necessary
Use dynamic props to set the slot property on the
Attempt to utilize this slot
What is expected?
The slot is loaded and display correctly
What is actually happening?
Dynamic properties don't seem to work on the component, so the "slot" property is getting set to null and it is not being loaded
The text was updated successfully, but these errors were encountered: