2.3.2
https://jsfiddle.net/frctmhLd/3/
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
The slot is loaded and display correctly
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
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.
Most helpful comment
I also updated the demo here. https://jsfiddle.net/frctmhLd/4/
Seems to be a bug with scoped slots.