当前位置:网站首页>[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 !
边栏推荐
- [Verilog basics] octal and hexadecimal representation of decimal negative numbers
- MC Instruction Decoder
- Hundreds of lines of code to implement a JSON parser
- POJ Project Summer
- 利用PIL进行不失真的resize
- Additional: (not written yet, don't look at ~ ~ ~) webmvcconfigurer interface;
- Rong Lianyun launched rphone based on Tongxin UOS to create a new ecology of localization contact center
- AVIC UAV technology innovation board is listed: the fist product with a market value of 38.5 billion is pterodactyl UAV
- 2022 Blue Bridge Cup group B - expense reimbursement - (linear dp| status DP)
- 【牛客网刷题系列 之 Verilog快速入门】~ 位拆分与运算
猜你喜欢

居家办公浅谈远程协助快速提效心得 | 社区征文

RT-Thread 堆区大小设置

【微信小程序】常用组件基本使用(view/scroll-view/swiper、text/rich-text、button/image)

Installing jupyter notebook under Anaconda

Good partner for cloud skill improvement, senior brother cloud of Amazon officially opened today
![Delete duplicates in an ordered array ii[double pointers -- unified in multiple cases]](/img/e2/cadfdbe476a86cb2d72c1ae0160a4a.png)
Delete duplicates in an ordered array ii[double pointers -- unified in multiple cases]

TCP Socket与TCP 连接

7 月 2 日邀你来TD Hero 线上发布会

中国传奇教授李泽湘,正在批量制造独角兽

赛芯电子冲刺科创板:拟募资6.2亿 实控人谭健为美国籍
随机推荐
备战数学建模34-BP神经网络预测2
招标公告:深圳市财政局数据库异地灾备项目
Implementation of Devops in the core field of qunar, the Internet R & D Efficiency
Tencent two sides: @bean and @component are used on the same class. What happens?
Good partner for cloud skill improvement, senior brother cloud of Amazon officially opened today
Mysql8 error: error 1410 (42000): you are not allowed to create a user with grant solution
register_ Chrdev and CDEV_ init cdev_ Add usage differences
Exception class_ Log frame
More dragon lizard self-developed features! Production available Anolis OS 8.6 officially released
Arcmap操作系列:80平面转经纬度84
BC1.2 PD协议
思源笔记:能否提供页面内折叠所有标题的快捷键?
Installing jupyter notebook under Anaconda
聊聊远程办公那些事儿 | 社区征文
register_chrdev和cdev_init cdev_add用法区别
更多龙蜥自研特性!生产可用的 Anolis OS 8.6 正式发布
2022蓝桥杯国赛B组-费用报销-(线性dp|状态dp)
【Verilog基础】十进制负数的八进制、十六进制表示
Additional: (not written yet, don't look at ~ ~ ~) webmvcconfigurer interface;
OpenCV中LineTypes各枚举值(LINE_4 、LINE_8 、LINE_AA )的含义
