How does the WeChat applet call a method in a loop? The following article will introduce to you a method to implement loop calls in WeChat applet. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Implementing a cyclic call to a method in the WeChat applet
If you want to call a method cyclically, you must judge a certain value. This method is called when the value is false. If it is true, it will not be called.
query:function(){
if(!!wx.getStorageSync('userInfo')){
let _this=this;
setTimeout(()=> {
_this.query();
},500);
return;
}
}This is a loop calling a method. It can be equipped with a flag to control the maximum number of loops, or write a method after the if. Do it after the loop ends.
Recommendation: " Mini Program Development Tutorial"
The above is the detailed content of How does a WeChat applet call a method in a loop?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.





