当前位置:网站首页>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
边栏推荐
- Matlab draw five-star red flag
- Mini - exercice MySQL (seulement pour les débutants, pas pour les non - débutants)
- 小女孩行走
- What is augmented reality technology? Where can it be used?
- 在sqli-liabs学习SQL注入之旅(第十一关~第二十关)
- 扣缴义务人
- Failed to prepare device for development
- OneFlow學習筆記:從Functor到OpExprInterpreter
- 考研线性代数常见概念、问题总结
- BK3633 规格书
猜你喜欢

ONEFLOW learning notes: from functor to opexprinter

搞不懂时间、时间戳、时区,快来看这篇

Download and install bashdb

The most concerned occupations after 00: civil servants ranked second. What was the first?

Valgrind et kcachegrind utilisent l'analyse d'exécution

PLC point table (register address and point table definition) cracking detection scheme -- convenient for industrial Internet data acquisition

npm ERR! network

Mini - exercice MySQL (seulement pour les débutants, pas pour les non - débutants)

MySQL小練習(僅適合初學者,非初學者勿進)

Star Trek强势来袭 开启元宇宙虚拟与现实的梦幻联动
随机推荐
Brief steps to build a website / application using flash and H5
MySQL小練習(僅適合初學者,非初學者勿進)
Summary of solid problems
web页面如何渲染
Complete binary search tree (30 points)
是否同一棵二叉搜索树 (25 分)
Withholding agent
Output first order traversal according to second order and middle order traversal (25 points)
Notes d'apprentissage oneflow: de functor à opexprinterpreter
数字政府建设中政务中台中的技术创新点
Enterprise wechat application authorization / silent login
Technological innovation in government affairs in the construction of Digital Government
js 原型链的深入
What is augmented reality technology? Where can it be used?
完全二叉搜索树 (30 分)
Error: cannot find or load main class
[Luke V0] verification environment 2 - Verification Environment components
Experimental report on analysis of overflow vulnerability of assembly language and reverse engineering stack
Concave hull acquisition method based on convex hull of point cloud
How to read excel table to database