javascript - Limit the number of WeChat mini programs loaded
習慣沉默
習慣沉默 2017-06-26 10:57:56
0
2
1207

I use leancloud as the backend, taking leancloud's demo as an example. If there are 10 data in Todo, how can I limit the page to load 5 first, and then load the next 5 data after the user slides to the bottom?

習慣沉默
習慣沉默

reply all(2)
代言

Use paging to implement
Call: scroll-view: https://mp.weixin.qq.com/debu...

<scroll-view style="height:500rpx;" scroll-y="true" bindscrolltoupper="loadNew" bindscrolltolower="loadMore">
<block wx:for="{{items}}">
  <view class="section">
    <video src="{{item.videoUrl}}" controls></video>
    <text>{{item.title}}</text>
  </view>
</block>
</scroll-view>

You can also use: onReachBottom

Page({
  onReachBottom: function()
  {
    this.loadList();
  }
})
淡淡烟草味

I’m here to test the reply process

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template