1.将图片数据循环并添加magnifyImag事件显示弹框
u-swiper绑定的数组为图片url数组
//第一种
<view class="profileDetail">
<view class="picList">
<scroll-view class="scroll-view_H" :scroll-x="true" scroll-left="0">
<u-image v-for="(item, index) in rmImagList" :key="index" class="scroll-view-item_H" width="260rpx" height="156rpx" :src="item" @click="magnifyImag(item)"></u-image>
</scroll-view>
<u-popup v-model="showBigImag" mode="center" :zoom="false">
<view class="" style="width: 690rpx; height: 486rpx;">
<u-swiper :list="rmImagList" height="486"></u-swiper>
</view>
</u-popup>
</view>
</view>
//第二种写法:
<view class="img_box" v-for="(it,index) in imgList" :key="index">
<image :src="it" mode="aspectFill" @click="magnifyImag(it)">
</image>
</view>
<u-popup v-model="showBigImag" mode="center" :

文章介绍了如何在Vue框架中使用u-swiper组件结合数组操作,实现图片列表的滚动和点击图片时弹出放大窗口的功能,包括两种不同的代码实现方式。
最低0.47元/天 解锁文章
9671

被折叠的 条评论
为什么被折叠?



