2.3.2
https://jsfiddle.net/frctmhLd/3/
使用必要的元素
使用动态道具在
尝试利用此插槽
插槽已加载并正确显示
动态属性似乎不适用于组件,因此“插槽”属性已设置为null且未加载
不确定如何标记它,将其标记为改进和错误
@posva @sparamasivan我错过了什么吗? 父组件中有两个根元素,因此会报告错误。
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哦,对不起,我忘了更新
我也在这里更新了演示。 https://jsfiddle.net/frctmhLd/4/
似乎是带有作用域插槽的错误。
谢谢大家解决此问题。
最有用的评论
我也在这里更新了演示。 https://jsfiddle.net/frctmhLd/4/
似乎是带有作用域插槽的错误。