其实就是在swiper-item下一个大盒子;计算出它的高度,然后让swiper高度等于它;swiperstyle=’height:{{swHeight}}px’swiper-itemwx:for=”{{tab}}”viewid=’dong’/view/swiper-item/swiperdata(){swHeight:”}onLoad:function(options){//给swiper设置高度当数据变化的时候;会增加高度;记得来重新调用varquery=wx.createSelectorQuery();query.select(‘#dong’).boundingClientRect()//dong是要计算盒子的高度query.exec(function(res){console.log(res);console.log(res[0].height);that.setData({swHeight:res[0].height//这里拿到的是px})})},
最新评论
不错的小程序案例
优秀的团队,不错的服务!
讲的很好
主播长的帅气
好系统好服务
优秀的团队
好服务,值得信赖
不错的服务