Home > WeChat Applet > Mini Program Development > Does the mini program have an immediate execution function?

Does the mini program have an immediate execution function?

angryTom
Release: 2020-03-20 17:35:02
Original
3677 people have browsed it

Does the mini program have an immediate execution function?

Does the mini program have an immediate execution function?

The mini program is developed using JavaScript language, so you can use an immediate execution function and place it in onLoad It can be done in the life cycle. For example,

onLoad:function(){
    (function () {
        console.log('小程序拥有立即执行函数');
    }());
}
Copy after login

It is recommended to define a function and then call it in onLoad so that the code can be reused.

onLoad:function(){
    this.de()
},
de:function(){
    ...........
}
Copy after login

Recommended learning: Small program development

The above is the detailed content of Does the mini program have an immediate execution function?. 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