当前位置:网站首页>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
边栏推荐
- I don't understand time, timestamp and time zone. Look at this article
- Notes d'apprentissage oneflow: de functor à opexprinterpreter
- 小程序报错:Cannot read property 'currentTarget' of undefined
- L2-022 重排链表 (25 分)(map+结构体模拟)
- About CIN, scanf and getline, getchar, CIN Mixed use of getline
- valgrind和kcachegrind使用运行分析
- [C language] document operation
- [in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)
- [Luke V0] verification environment 2 - Verification Environment components
- 完全二叉搜索树 (30 分)
猜你喜欢

bashdb下载安装

BK3633 规格书

OneFlow学习笔记:从Functor到OpExprInterpreter

Notes d'apprentissage oneflow: de functor à opexprinterpreter

在sqli-liabs学习SQL注入之旅(第十一关~第二十关)
![[in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)](/img/c9/43a63f526068ef6a3e4964a22c5a1f.png)
[in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)

LaTeX论文排版操作

Failed to download esp32 program, prompting timeout

GoLand debug go use - white record

请提前布局 Star Trek突破链游全新玩法,市场热度持续高涨
随机推荐
Flink同时读取mysql与pgsql程序会卡住且没有日志
Bk3633 specification
数字政府建设中政务中台中的技术创新点
Go language self-study series | golang structure pointer
单片机数码管秒表
Talent Plan 学习营初体验:交流+坚持 开源协作课程学习的不二路径
【原创】使用System.Text.Json对Json字符串进行格式化
政务中台研究目的建设目标,建设意义,技术创新点,技术效果
The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution
npm报错 :operation not permitted, mkdir ‘C: \Program Files \node js \node_ cache _ cacache’
[original] use system Text. JSON formats the JSON string
Pctp test experience sharing
Brief steps to build a website / application using flash and H5
论文阅读《Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry》
idea打包 jar文件
Concave hull acquisition method based on convex hull of point cloud
L2-022 rearrange linked list (25 points) (map + structure simulation)
Go language self-study series | golang structure as function parameter
Consensus Token:web3. 0 super entrance of ecological flow
Share the office and improve the settled experience