Home  >  Q&A  >  body text

javascript - Limit the number of WeChat mini programs loaded

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?

習慣沉默習慣沉默2674 days ago1176

reply all(2)I'll reply

  • 代言

    代言2017-06-26 10:59:56

    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();
      }
    })

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-26 10:59:56

    I’m here to test the reply process

    reply
    0
  • Cancelreply