当前位置:网站首页>[wechat applet] the hosting environment of the applet
[wechat applet] the hosting environment of the applet
2022-06-30 16:51:00 【Su Liang py】
Author's brief introduction : Su Liang ( Focus on web crawlers , Data analysis , On the way to learning the front end )
Blog home page : Su Liang .py The blog of
Series column : Basic course of applet development
Aphorisms : The sea is wide with fish , The sky is high and the birds are flying .
If you think the blogger's article is good , I hope you can support me for the third time in a row !!!
Follow the likes collection
List of articles
Daily recommendation
Recommend an artifact to everyone . Whether you are a student party or an office worker, you can use , The interview question bank is covered here , Brush questions online , Interviews with major manufacturers / Written test questions, etc . If you're still a student , The most important point is the simulated interview function , intelligence AI1v1 interview , Help you get to the big factory as soon as possible offer! Click the link to go directly to !=> Cattle from - Looking for work artifact
Host environment
One 、 What is the host environment ?
Host environment ( host environment) It refers to the dependent environment necessary for the program to run .
for example :Android Systems and iOS The system is two different host environments . Android version of wechat App No iOS Operating in the environment , therefore ,Android It is the host environment of Android Software , Software that leaves the host environment is meaningless !
Two 、 The host environment of the applet
On mobile phone , The hosting environment of the applet is our mobile wechat , Typically, applets can be implemented by leveraging the capabilities provided by the hosting environment , It can complete many functions that ordinary web pages can't : Wechat payment , Wechat code scanning , Wechat login, positioning, etc .
3、 ... and 、 What the applet hosting environment contains
1. Communication model
The subject of communication
The main body of communication in applet is rendering layer and logic layer , among :
- WXML Templates and WXSS Styles work in the render layer
- JS Scripts work at the logical level

Communication model of applet
The communication model in the applet is divided into two parts ( Are forwarded by wechat clients )
Communication between rendering layer and logic layer

Communication between logical layer and third-party server

2. Operating mechanism
The process of starting an applet
- Download the code package of the applet to the local
- analysis app.json Global profile
- perform app.js Applet entry file , call App() Create an instance of the applet
- Rendering applet home page
- Applet startup completed
Applet page rendering pass
- Load the of the parsing page .json The configuration file
- To load a page .wxml Templates and .wxss style
- Execute the .js file , call Page() Create page instances
- Page rendering complete
3. Components
Components in the hosting environment are also provided by , Developers can quickly build a beautiful page structure based on components . Officials divide the components of small programs into 9 Categories: , Namely :
- View container
- Basic content
- Form components
- Navigation components
- Media components
- map Map components
- canvas Canvas components
- Opening ability
- Accessibility
4.API
Small program official API It is divided into the following 3 Categories: :
Event monitoring API
characteristic : Withonstart , Used to monitor the trigger of some events
give an example :wx.onWindowResize(function callback)Listen for window size changesSync API
characteristic 1: WithSyncAt the end of the API It's all synchronous API
characteristic 2: Sync API The results of the implementation of , You can get directly through the return value of the function , An exception will be thrown if there is an error in execution :wx.setStorageSync("'key" , 'value')Write content to local storageasynchronous API
characteristic : Be similar to jQuery Medium$.ajax(options)function , Need to pass throughsuccess、fail、completeExample of result of receive call :wx.request()Initiate a network data request , adoptsuccessThe callback function receives data
More question banks and summary of knowledge points , Interview skills => Cattle from , Come and brush the questions with me !
边栏推荐
- Talk about telecommuting | community essay solicitation
- Tencent two sides: @bean and @component are used on the same class. What happens?
- 9:第三章:电商工程分析:4:【通用模块】;(待写……)
- Mysql8 error: error 1410 (42000): you are not allowed to create a user with grant solution
- I implement "stack" with C I
- 备战数学建模34-BP神经网络预测2
- 牛客网:有多少个不同的二叉搜索树
- 异常类_日志框架
- 抖快B为啥做不好综艺
- 香港回归25周年 香港故宫博物馆正式开放成文化新地标
猜你喜欢

RT-Thread 堆區大小設置

Anaconda下安装Jupyter notebook

MySQL transaction / lock / log summary

ArcMap operation series: 80 plane to latitude and longitude 84

Etcd教程 — 第八章 Etcd之Compact、Watch和Lease API

【活动报名】探秘元宇宙,就差你了!7月2号我在深圳现场等你!

Bc1.2 PD protocol

名单揭晓 | 2021年度中国杰出知识产权服务团队

利用PIL进行不失真的resize

中航无人机科创板上市:市值385亿 拳头产品是翼龙无人机
随机推荐
MC Instruction Decoder
2022新消费半年盘点:行业遇冷,但这九个赛道依然吸金
Lambda expression_ Stream stream_ File class
Halcon knowledge: matrix topic [02]
The inspiration from infant cognitive learning may be the key to the next generation of unsupervised machine learning
新茶饮“死去活来”,供应商却“盆满钵满”?
IO流_递归
Etcd教程 — 第八章 Etcd之Compact、Watch和Lease API
Additional: (not written yet, don't look at ~ ~ ~) corsfilter filter;
Implementation of Devops in the core field of qunar, the Internet R & D Efficiency
The new tea drinks are "dead and alive", but the suppliers are "full of pots and bowls"?
Anaconda下安装Jupyter notebook
Talk about telecommuting | community essay solicitation
RTP 发送PS流零拷贝方案
招标公告:深圳市财政局数据库异地灾备项目
There are so many kinds of coupons. First distinguish them clearly and then collect the wool!
Explain in detail the use of for loop, break and continue in go language
聊聊远程办公那些事儿 | 社区征文
附加:(还没写,别看~~~)CorsFilter过滤器;
数据挖掘知识点整理(期末复习版)
