<swiper circular="true" autoplay="true" indicator-dots="true">
<swiper-item v-for="(swiper, index) in imglist" :key="index">
<image :src="swiper" @tap="preview(imglist)"></image>
</swiper-item>
</swiper>
js部分
preview(imgs){
// imgs=imgs.split(',')
uni.previewImage({
urls: imgs,
longPressActions: {
itemList: ['保存圖片'],
success: function(data) {
//data.tapIndex按鈕下標(biāo) 更耻,data.index圖片下標(biāo)
if(data.tapIndex==0){
uni.saveImageToPhotosAlbum({
filePath: imgs[data.index],
success: function () {
uni.showToast({
title:'保存成功'
})
}
});
}
},
fail: function(err) {
console.log(err.errMsg);
}
}
});
},