WeChat applet development applet architecture

Source: Internet
Author: User
This article introduces the architecture of small program development. I. applet architecture

The structure of each applet is composed of two main parts:Subject + pages.

Similar to many frameworks, the main part is mainly used for core configuration, and each page is mainly used for different business scenarios.

1.1. the subject consists of three files.

1) app. js: small program logic, APP initialization

2) app. json: small program configuration, such as navigation, window, page http request jump, etc.

3) app. wxss: public style configuration

After the configuration of the subject is completed, it is the corresponding business development, that is, the most common page for developers. The small program page design is basically built according to the MVC structure.

The full name of MVC is Model View Controller, short for model-view-controller. it is a Model of software design, organize code by means of separation of business logic, data, and interface display, and integrate the business logic into a component to improve and personalize the custom interface and user interaction, you do not need to rewrite the business logic. MVC is uniquely developed to map traditional input, processing, and output functions in a logical graphical user interface structure.

1.2. the page consists of four files

1) js: Page logic, equivalent to the control layer (C); also includes part of the data (M)

2) wxml: displays the page structure, which is equivalent to the view layer (V)

3) wxss: page style table, pure front-end, used to assist in wxml display

4) json: page configuration, configure the data displayed on some pages, and act as part of the model (M)

Related articles:

Detailed description of small program data access instances

Detailed description of the instance code of the applet label component

Detailed steps of examples of mini-program development tutorials

The above is a detailed illustration of the small program development architecture. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.