A组件内容
<li class="product_item" v-for="(item,index) in imgs" :key="index" >
<a @click="$router.push('/home/goodsdetail/' + item.id)">
<div style="height:180px">
<img v-lazy="item.src" alt="">
</div>
<p class="mui-ellipsis ds_ellipsis mui-text-left">12345 </p>
<div class="price_cart">
<span>¥560.00</span>
<slot :item="item"/>
</div>
</a>
</li>
// imgs通过props传入
B组件中使用A组件
<A :imgs="imgs">
<button class="ds_addshopcart" slot-
scope="slotProps">cart</button>
</A>