我需要在v-for循环中渲染一个带有插槽的组件,如下所示:
<div v-for="(data,index) in myList" :key="index">
<datepicker v-model="data.thru">
<div slot="beforeCalendarHeader" @click="selectToday" class="today p-2 text-center">
Today
</div>
</datepicker>
</div>
我得到以下错误:
[Vue warn]: Duplicate presence of slot "beforeCalendarHeader" found in the same render tree - this will likely cause render errors.
我如何在循环内使用componentns插槽?