小程序下拉刷新页面

  1. app.json中设置开始下拉操作
    "enablePullDownRefresh":true
  2. 文件.js中引用
    /**
       * 页面相关事件处理函数--监听用户下拉动作
       */
      onPullDownRefresh: function () {
        wx.showToast({
          title: '正在刷新数据...',
          icon: 'loading',
          duration: 2000
        });
        this.setData({fabus:[]});//先清空数据
        this.loadIndex();//再重新加载数据
        wx:wx.stopPullDownRefresh();//停止刷新操作
      },

猜你喜欢

转载自blog.csdn.net/zdklhh/article/details/88945577