当前位置:网站首页>Uniapp to preview pictures (single / multiple)

Uniapp to preview pictures (single / multiple)

2022-06-25 16:39:00 Like angels

uniapp Realize the picture ( Single sheet / Multiple sheets ) preview

One 、 Single preview

			getImgIndex(index) {
    
				let imgs = this.temperatureData.map(item => {
    
					return item.img
				})
				uni.previewImage({
    
					urls: imgs,
					current: index
				})
			},

Two 、 Multiple previews

			getImgIndex(index) {
    
				this.imgArray = [];
				this.imgArray = this.temperatureData[index].img
				uni.previewImage({
    
					current: 0, // Which page is it currently 
					urls: this.imgArray,
					indicator: 'number',
					loop: true
				});
			},

design sketch :

preview

We’re not put on this Earth to think of only ourselves

原网站

版权声明
本文为[Like angels]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206251546587645.html