Example of WeChat applet: code to implement pull-down refresh data

不言
Release: 2018-08-10 16:01:05
Original
2843 people have browsed it

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);
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!