小程式之上拉載入和下拉重新整理

2021-09-26 09:35:32 字數 536 閱讀 3448

建立data

/*** 頁面的初始資料

*/   

data: ,

分頁請求資料

/*** 生命週期函式--監聽頁面載入

*/onload: function (options) ,

getarticleinfo: function(index));

wx.showtoast()

}else);}}

})},

上拉重新整理

/*** 頁面上拉觸底事件的處理函式

*/onreachbottom: function () )

// 傳送請求  

this.getarticleinfo(index);

}else)}},

下拉重新整理

/*** 頁面相關事件處理函式--監聽使用者下拉動作

*/onpulldownrefresh: function () )

// 傳送請求  

this.getarticleinfo(this.data.index);

},

小程式之上拉載入和下拉重新整理

頁面的初始資料 data 生命週期函式 監聽頁面載入 onload function options getarticleinfo function index wx.showtoast else 頁面上拉觸底事件的處理函式 onreachbottom function 傳送請求 this geta...

小程式上拉載入下拉重新整理

筆者這邊上拉載入使用的函式是 onreachbottom,沒有使用scroll view data 生命週期函式 監聽頁面載入 onload function options 商品 goods function that,urls function error 頁面上拉觸底事件的處理函式 onrea...

微信小程式 下拉重新整理 上拉載入

1.下拉重新整理 小程式頁面整合了下拉功能,並提供了介面,我們只需要一些配置就可以拿到事件的 具體頁面的.json檔案 1 1 window 2.在js檔案中新增 函式 下拉重新整理 介面 onpulldownrefresh function 3.新增資料 通常情況下的下拉重新整理操作,就是把查詢條...