网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

微信小程序 scroll-view滾動到底部事件不觸犯的鍋

發布時間:2018-05-29 11:03 所屬欄目:小程序開發教程

今日準備把微信小程序的下拉刷新做一下,沒想到我綁定了bindscrolltolower事件,但是居然不觸發,我設置了lower-threshold高度無濟于事.最后經過不懈的努力,找了很多資料,才發現,居然要設置scroll-view高度,于是我在.wxss里設置了高度為100%:

.scrollStyle{
   width: 100%;
   height: 100%; 
   display: flex;
  flex-direction: column; 
}

居然無效,修改height為具體高度也無效.
然后我在 style里設置height為200px,居然生效了:

<scroll-view style='height:{{scrollHeight}}px' class='scrollStyle' scroll-y='true' slot="0" hidden="{{curindex != 0}}" bindscrolltolower="loadMoreData" lower-threshold="100">

注意:style里的height單位必須寫px;
scrollHeight怎么來的?是獲取了屏幕高度,代碼如下:

 let  scrollHeight = wx.getSystemInfoSync().windowHeight;
    this.setData({
      scrollHeight: scrollHeight
    });

scrollHeight其實是減去導航欄和tabbar的高度!
ps:很啃爹只能寫在style里才生效.


易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/24465.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×