This article brings you an example of a WeChat applet: the code to implement pull-down refresh data, which has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Calling the system's API, the system provides the pull-down refresh API interface onPullDownRefresh
First add "enablePullDownRefresh":"true" to the json configuration file to turn on the pull-down refresh event,
After processing the data refresh, wx.stopPullDownRefresh can stop the pull-down refresh of the current page.
The code in the js file of the mini program is as follows:
onPullDownRefresh;function(){ wx.showNavigationBarLoading()//在标题栏中显示加载 //模拟加载 setTimeout(function(){ wx.hideNavigationBarLoading()//完成停止加载 wx.stopPullDownRefresh()//停止下拉刷新 },1500); }
Recommended related articles:
Mini program example: Mini program realizes the effect of folding menu (with code )
Mini Program Component: Introduction to Chat Session Component (with code)
The above is the detailed content of Example of WeChat applet: code to implement pull-down refresh data. For more information, please follow other related articles on the PHP Chinese website!