Tip:一定要给scroll-view设置一个固定高度,不然scroll-view滑动的时候会不停的调用bindscrolltolower函数。
wxml
<scroll-view
scroll-y
bindscrolltolower="handleToLower"
style="height: {{windowHeight}}px;">
<block wx:for="{{99}}" wx:key="index">
<view class="">item内容</view>
</block>
</scroll-view>
js
data: {
windowHeight:0,
oneWordList: [],
},
onLoad: function (options) {
var _this = this;
//获取屏幕高度
wx.getSystemInfo({
var _this = this;
//设置屏幕高度
success: function (res) {
_this.setData({
windowHeight: res.windowHeight
})
console.log("屏幕高度: " + res.windowHeight)
}
})
},
handleToLower: function () {
console.log("上拉加载")
},