Introduction to the Hosting Environment of WeChat Mini Programs

1. What is a hosting environment?

  The host environment is the environment that the program must rely on. For example, Android and ios are two different host environments. Software that relies on the Android host environment cannot run in the iOS host environment, and software that relies on the iOS host environment cannot run in the Android host environment. run.

2. What is the host environment of the Mini Program?

The host environment of the Mini Program is WeChat.

 

3. Content contained in the host environment of the Mini Program

1. Communication model

The communication model of the applet mainly includes two parts:

(1) Communication between rendering layer (wxml and wxss) and logic layer (js file): forwarded by WeChat client.

(2) Communication between the logic layer (js file) and third-party services: forwarded by the WeChat client.

2. Operating mechanism

1) The startup process of the applet

Download the applet code package ---------------- Parse the app.json global configuration file ---------- Execute the entry function of the applet's entry file app.js App() ------------------Rendering the home page of the applet ---------The applet startup is complete

2) The startup process of the page

Load the json configuration file of the page ----------- load the .wxml template and .wxss style of the page --------- execute the js file of the page, call Page() to create a page instance- ---- Page rendering is complete

3. Components and APIs

The host environment of the Mini Program also provides components and APIs for the Mini Program to use. The Mini Program component mainly implements the page operations of the Mini Program. transfer.

Guess you like

Origin blog.csdn.net/psjasf1314/article/details/127119977