一、效果图
![在这里插入图片描述](https://img-blog.csdnimg.cn/86b2f624ee15489cae28cffd4f921d94.gif#pic_center)
二、代码块
<template>
<view>
<view v-for="(item,index) in photos" :key="index" >
<view class="box">
<image :src="item.pics_small_url" mode="widthFix" @click="previewImage(index)"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
photos: [{
id: '1',
pics_small_url:'https://fc5tn.baidu.com/it/u=1112089068,583547811&fm=202&src=787&fc_m=cvican',
pics_big_url:'https://fc5tn.baidu.com/it/u=1112089068,583547811&fm=202&src=787&fc_m=cvican'
},{
id: '2',
pics_small_url:'https://fc5tn.baidu.com/it/u=1789275420,3071612989&fm=202&src=787&fc_m=cvican',
pics_big_url:'https://fc5tn.baidu.com/it/u=1789275420,3071612989&fm=202&src=787&fc_m=cvican',
}]
}
},
methods:{
previewImage(index) {
let photoList = this.photos.map(item => {
return item.pics_big_url;
});
uni.previewImage({
current: index,
urls: photoList
});
}
}