第一種:onReachBottomthis
第二種:使用scroll-view組件spa
<scroll-view scroll-y="true" bindscrolltolower="bindMore" style="height:450px"> <view class="all-class-title">班級列表</view> <view bindtap="onChoice"> <view class="class-name all-class-title-list" wx:for="{{state.list_ten}}" data-clazzName="{{item.clazzName}}" data-id="{{item.id}}">{{item.clazzName}} </view> <view wx:if="{{state.bottom}}">正在加載</view> </view> </scroll-view>
bindMore(){ this.setState({bottom:true}) //發送請求 }
<scroll-view scroll-y="true" lower-threshold="400" bindscrolltolower="bindMore" style="height:450px"> </scroll-view>
以上僅爲我的想法,若有不一樣看法請評論哦code