当前位置:网站首页>A must see wechat applet development guide 1 - basic knowledge
A must see wechat applet development guide 1 - basic knowledge
2022-04-23 09:03:00 【It's a genius】
Hello, hello , Hello, everyone , I'm glad you can see this article !
I am currently a freshman in computer science , Self taught wechat applet development based on hobbies . And here I want to through my personal understanding of the whole learning process , Tell your friends about wechat applet development. You can understand it in simple language .
Because I am also a learner like you , So the mistakes in the article , I hope you can point out more ~

Catalog
1. The project structure of the applet
3. Global profile and local profile
4. Configuration files that two novices must understand
5. The host environment of the applet
6. Communication model of applet
8. The process of page rendering
1. The project structure of the applet
Here we focus on a few files that novices must know
pages: Store all pages in the applet
app.js: The work performed by the logic layer of the applet project
app.json: Global applet configuration file
app.wxss: The global style file of the applet project
project.config.json: The configuration file for the project
sitemap.json: It is used to configure whether the applet and its page can be searched by wechat .

2. Part of the applet page

You can see it here pages Directory of There are also two directories , One is index, The other is lianxi. In these two directories, we can see that there are four with .js .json .wxml .wxss A file with a suffix . and index.js,index.json,index.wxml,index.wxss Four documents work together to form a index Applet page .
.js: Script file of the page , Store the data of the page , Event handling functions, etc
.json: The configuration file of the current page , Configure window appearance, etc
wxml: The template structure file of the page
wxss: in the light of wxml Modify the components defined in
3. Global profile and local profile
Global profile : all With app The first files are global configuration files , Uniformly configure the contents of all applets

Local configuration file : Configure the content of the configuration page in the current directory separately . Be careful Local configuration file > Global profile

4. Configuration files that two novices must understand
1.app.json: This configuration file we You must know four functions
pages: Record the path of all pages of the current applet
window: Globally define the background color of all pages of the applet , Text color, etc .
style: Globally define the style version used by the applet component .
sitemapLocation: Used to specify that sitemap.json The location of .

Here's the key to understand A function -pages.
Here we can see pages We have four lines in the function , These four lines Is the current applet you The path of all pages . And on the first line "pages/list/list" It's the first page we see when we open the app .
If you need to add a new page , As long as pages Function to add the corresponding path to complete the addition

Here we first see On the far right we are pages Function added "pages/regz/regz" Created a code-named rgzn The page of ( The folder will also be created , The red brackets in the middle can see ), Finally, we found that the page on the left is be known as regz The page of .
2.project.config.json file : Here, let's look at three important functions
setting: Compile related configuration
projectname: Project name
appid: The account number of the applet ID
Note here appid This function , The content of this function is your personal ID

5. The host environment of the applet
Host environment : The environment on which the program runs , For example , We're in steam Games bought on the Internet can only be played in windows Use of , Once in a linux You can't use it in the system .
The hosting environment of the applet is mobile wechat .
6. Communication model of applet
Applet The main body of communication is divided into three parts
1. Render layer : from wxml Templates and wxss Style responsible
2. Logic layer : js The script is responsible for
3. Third party servers .

Render layer , The data transmission between the logical layer and the third-party server is completely controlled by native( Wechat client is responsible for )
7. Applet operation mechanism
1. The applet is downloaded locally
2. analysis app.json Global profile
3. perform app.js The contents of the document
4. Rendering applet home page
5. Applet startup completed
8. The process of page rendering
1. Load the of the parsing page .json The configuration file
2. To load a page .wxml Templates and wxss. style
3. Execute the .js file , call page() Function to open the corresponding page
4. Render completed
All right, all right, friends, that's the end of our content today , Today's content is over here , Today's learning content is not much , Just watch the key several times , If you don't know anything, remember to ask questions in the forum ~
If your friends feel that the content of the article is helpful to you , Sure give the thumbs-up , Follow articles and columns as well as Pay attention to me ~ Hey, hey, hey ~ I will update the article regularly , Thank you for your support ~

版权声明
本文为[It's a genius]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230720596930.html
边栏推荐
- 小程序报错:Cannot read property 'currentTarget' of undefined
- PLC point table (register address and point table definition) cracking detection scheme -- convenient for industrial Internet data acquisition
- 2021 Li Hongyi's adaptive learning rate of machine learning
- The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution
- 2022-04-22 openebs cloud native storage
- Error: cannot find or load main class
- Study notes of deep learning (8)
- Use include in databinding
- Data visualization: use Excel to make radar chart
- ONEFLOW learning notes: from functor to opexprinter
猜你喜欢

Download and install bashdb

I don't understand time, timestamp and time zone. Look at this article

cadence的工艺角仿真、蒙特卡洛仿真、PSRR

爬虫使用xpath解析时返回为空,获取不到相应的元素的原因和解决办法

ONEFLOW learning notes: from functor to opexprinter

The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution

Open services in the bottom bar of idea

Consensus Token:web3.0生态流量的超级入口

npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’

To remember the composition ~ the pre order traversal of binary tree
随机推荐
npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
Learn SQL injection in sqli liabs (Level 11 ~ level 20)
LeetCode_DFS_中等_1254. 统计封闭岛屿的数目
Failed to prepare device for development
L2-3 浪漫侧影 (25 分)
2022-04-22 OpenEBS云原生存储
资源打包关系依赖树
Taxable income
Chris LATTNER, father of llvm: the golden age of compilers
L2-022 rearrange linked list (25 points) (map + structure simulation)
Download and install bashdb
DJ music management software pioneer DJ rekordbox
Go language self-study series | golang structure as function parameter
数字政府建设中政务中台中的技术创新点
ATSS(CVPR2020)
valgrind和kcachegrind使用運行分析
Introduction to GUI programming swing
How does kubernetes use harbor to pull private images
web页面如何渲染
Share the office and improve the settled experience