久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      uniapp如何實現(xiàn)懶加載

      uniapp實現(xiàn)懶加載的方法:可以使用【onReachBottom()】這個生命周期函數(shù),讓頁面滾到到最底部時,進(jìn)行加載操作,代碼為【onReachBottom: function()】。

      uniapp如何實現(xiàn)懶加載

      本教程操作環(huán)境:windows7系統(tǒng)、uni-app2.5.1版本,該方法適用于所有品牌電腦。

      推薦(免費):uni-app開發(fā)教程

      uniapp實現(xiàn)懶加載的方法:

      在uni-app中,當(dāng)我們需要讓請求的數(shù)據(jù)進(jìn)行懶加載時,可以使用onReachBottom()這個生命周期函數(shù),讓頁面滾到到最底部時,進(jìn)行加載操作。

      這里的p是頁碼參數(shù),每加載一次,per+1.

      onLoad() { // ajax請求 this.ajaxCode(this.per) }, onReachBottom: function() { // 下拉懶加載 ++this.per; uni.request({ url: 'https://www.zrzj.com/api/index/homePage', method: 'get', data: { p: this.per }, success: (res) => { var next_data = res.data.result // 加載新數(shù)組 this.products = this.products.concat(next_data) } }) }, methods: { ajaxCode(per) { uni.request({ url: 'https://www.zrzj.com/api/index/homePage', method: 'get', data: { p: per }, success: (res) => { var _data = res.data.result this.products = _data; } }) } }

      相關(guān)免費學(xué)習(xí)推薦:編程視頻

      贊(0)
      分享到: 更多 (0)
      ?
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號