【发布时间】:2016-09-29 21:13:01
【问题描述】:
自定义组件中是否可以有多个插槽?
即
<template>
<slot id="first"></slot>
<slot id="second"></slot>
</template>
【问题讨论】:
标签: html aurelia aurelia-templating
自定义组件中是否可以有多个插槽?
即
<template>
<slot id="first"></slot>
<slot id="second"></slot>
</template>
【问题讨论】:
标签: html aurelia aurelia-templating
是的,但您应该使用name 而不是id。
<template>
<div>
The first slot:
<div>
<slot name="slot1"></slot>
</div>
The second slot:
<div>
<slot name="slot2"></slot>
</div>
</div>
</template>
现在记录在这里:http://blog.durandal.io/2016/05/23/aurelia-shadow-dom-v1-slots-prerelease/我很快就会将它添加到自定义元素文档的内容投影部分。
【讨论】: