在uni-app中:
自定义组件 scroll-list
<template>
<view v-for="(item, index) in dataList.rows" :key="index">
<slot name="item" :item="item"></slot>
</view>
</template>
使用组件
<scroll-list :dataList="dataList" :actionOptions="options">
<template #item="{item}">
<view class="item" @click="toDetail(item.id)">
</view>
</template>
</scroll-list>
提示:slot "item" duplication is found under a single shadow root. The first one was accepted
怎么处理?
#item="{item}"
改成#item="item"