微信小程序开发踩过的坑

1 swiper

使用swiper显示列表时,如果不设置swiper的高度,则数据会显示不完整,网上找了一大堆,小结一下
解决:wx.getSystemInfo+scroll-view

 <swiper class="swiper" style="height: {{clientHeight?clientHeight+'px':'auto'}}"    current="{{currentTab}}" duration="200" bindchange="swiperChange">
    <swiper-item>
      <scroll-view scroll-y="{{true}}" style="height: {{clientHeight?clientHeight+'px':'auto'}}">
      xxxxx内容xxxxx
      </scroll-view>
    </swiper-item>
    <swiper/>
    
 可在onLoad()方法里写
 wx.getSystemInfo({ 
        success: function (res) {
          console.log(res.windowHeight+"px") 
            this.setData({ 
                clientHeight: res.windowHeight 
            }); 
        } 
    }) 

2 checkbox修改框的大小,不能通过宽高,通过transform

 
.reset_size {
  transform: scale(0.8,0.8);
}

你可能感兴趣的:(微信小程序,前端,javascript)