(1) Directory structure of WeChat applet

1. Official website of WeChat mini program development:

https://developers.weixin.qq.com/miniprogram/dev/framework/structure.html

 

2. Directory structure:

A mini program consists of an app as a whole and multiple pages describing their respective pages. The main part of a small program is mainly composed of three files, and these three files must be placed in the root directory of the project. as the picture shows:

3. Use the WeChat applet development tool to create a new project. The structure is as follows: The main thing is that the files in the red box must be in the root directory of the project, otherwise the project will report an error.

4. Explain the role of project.config.json and sitemap.json files in the project:

project.config.json: Configuration of development tools

For example, interface color, compilation configuration, etc., when you change to another computer and reinstall the tool, you have to reconfigure it.

Taking this into account, the Mini Program Developer Tool will generate a file in the root directory of each project  project.config.json. Any configuration you make on the tool will be written to this file. When you reinstall the tool or change the computer to work, you only need to download If you import the code package of the same project, the developer tools will automatically help you restore the personalized configuration when you were developing the project, including the color of the editor, automatic compression when uploading the code, and a series of options.

sitemap.json: WeChat now allows search within mini programs. Developers can sitemap.jsonconfigure whether their mini program pages allow WeChat indexing through configuration or by managing the background page inclusion switch. Detailed configuration: https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html.

5. Use the developer tools of WeChat applet to create a new project testDemo. The directory structure is as follows:

6. The operation effect diagram is as follows:

7. The bottom tabBar in the above picture must have at least 2 items and at most 5 items.

The basic framework of such a WeChat applet has been built, and I personally think it is faster to develop than Android. The WeChat envelope has the components installed, just call it. The only bad thing is that the developer tools provided are not very easy to use. Code prompts are not very practical, which affects development efficiency. It is recommended to use other development tools such as visual Studio, and then use the development tools provided by WeChat to preview the effect.

 

Guess you like

Origin blog.csdn.net/beautifulYuan/article/details/99292165