Small program host environment

1. Introduction to host environment


1. What is a host environment

  • 宿主环境(host environment) refers to 程序运行所必须的依赖环境.
  • Such as: Android系统and iOS系统are two different host environments.
  • The Android version of the WeChat App cannot run in the iOS environment, so Android is the host environment for Android software.脱离了宿主环境的软件是没有任何意义的!
    insert image description here

2. The host environment of the applet

insert image description here

3. Contents contained in the Mini Program host environment

  • communication model
  • operating mechanism
  • components
  • API

2. Communication model


1. Subject of communication

insert image description here

2. Mini-program communication model

insert image description here

3. The process of starting the applet

  • Download the code package of the applet to the local
  • Parse the app.json global configuration file
  • Execute the app.js applet entry file,调用App()创建小程序实例
  • Render the home page of the applet, and the applet is started

4. The process of page rendering

  1. Load the .json configuration file of the parsing page \
  2. Load the .wxml template and .wxss styles for the page
  3. Execute the .js file of the page,调用 Page()创建页面实例
  4. Page rendering is complete

3. Components


1. Classification of components in applets

insert image description here

2. Commonly used view container components

insert image description here

3. Basic use of view components

insert image description here

4. Basic usage of scroll-view component

insert image description here

5. Basic use of swiper and swiper-item components

insert image description here

6. Common properties of swiper components

insert image description here

7. Commonly used basic content components

insert image description here

8. Basic use of text components

insert image description here

9. Basic use of rich-text components

insert image description here

10. Other common components

insert image description here

11. Basic use of button buttons

insert image description here

12. Basic usage of image component

insert image description here

13. The mode attribute of the image component

insert image description here

4. APIs

1. Mini Program API Overview

  • 小程序中的 API 是由宿主环境提供的, through these rich mini-program APIs, developers can easily call the capabilities provided by WeChat, such as obtaining user information, local storage, payment functions, etc.

2. Three categories of Mini Program APIs

insert image description here

Guess you like

Origin blog.csdn.net/m0_58190023/article/details/129644459
Recommended