About uniapp using Swiper and swiper-iteam scroll-view and vertical slide and the width and height Problems

Use swiper in uniapp must be set height, usually set dynamically.

* Number one is the height, not to explain here.

Another is swiper + scroll-view combination, the height of the sliding acquisition system at this height, the point here is the second.
Here Insert Picture Description
Swiper bind a highly
Here Insert Picture Description
in -iteam swiper the nested scroll-view height, and scroll-view is set to 100%

.scrol{
		height: 100%;
}

Set the height swiper in the js

data(){
	return{
		swiperHeight:''
	}
}
onLoad() {
	uni.getSystemInfo({	//获取系统信息
		success: (res) => {
			this.swiperHeight = res.windowHeight + 'px'
		},
		fail: (res) => {
			console.log('error')
		}
	})
}
Released three original articles · won praise 6 · views 150

Guess you like

Origin blog.csdn.net/SupAack/article/details/104377466