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.
Swiper bind a highly
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')
}
})
}