onReachBottom开发者工具(v1.01.1711300)上只能触发一次
<view class="reciter-container container"> <view class="tab-bar"> <view class="tab-bar-left"> </view> <view bindtap="switchTab" data-index="{{item.index}}" class="{{(tab.current == item.index) ? 'tab-bar-item-current' : ''}} tab-bar-item" wx:for-items="{{tabs}}" wx:key="{{index}}"> {{item.display}} </view> <view class="tab-bar-query"> </view> </view> <view class="reciter-content" scroll-y="{{true}}"> <view class="reciter-content-main"> <view style="width: 100px;" wx:for-items="{{reciterList}}" wx:key="{{index}}">{{item.name}}</view> </view> </view></view> |
Page({ data: { tabs: [{index: 0, display: '朗诵'}, {index: 1, display: '诗词'}, {index: 2, display: '比赛'}], tab: { current: 0 }, reciterList: [], }, onPullDownRefresh: function() { console.log('onPullDownRefresh'); wx.showNavigationBarLoading(); setTimeout(() => {wx.stopPullDownRefresh(); console.log('stopPullDownRefresh'); wx.hideNavigationBarLoading()}, 3000) }, onReachBottom: function() { console.log('onReachBottom'); this.setData({reciterList: this.data.reciterList.concat([{name: 'a'}])}); }, onShow: function () { console.log('onShow'); }, switchTab: function(e) { this.setData({ tab: { current: e.currentTarget.dataset.index } }); }, fetchData: function() { }}) |
{ "usingComponents": { "list-item": "../components/list_item/index" }, "enablePullDownRefresh": true, "onReachBottomDistance": 50} |
事件在开发者工具和手机上都只能触发一次,正常么?如何触发多次?
