uni-app: setTimeout function (executed after the delay time)

 The following code means that after 500 milliseconds (ie 0.5 seconds), the code you write in the function will be executed. You can put the code that needs to be executed in the comment section.

setTimeout(function() {
    // 在这里写要执行的代码
}, 500);

For example:

After 500 milliseconds, the console will output "Hello, world!".

setTimeout(function() {
    console.log("Hello, world!");
}, 500);

Guess you like

Origin blog.csdn.net/weixin_46001736/article/details/131889102