Home > Article > WeChat Applet > In-depth analysis of global configuration in mini programs
This article will talk about the global configuration in the mini program, and learn about the common configuration items and page configuration files in the mini program. I hope it will be helpful to you!
app.json
in the root directory of the mini program The file is the global configuration file of the applet. Commonly used configurations are as follows:
pages
: Record the storage path of all pages of the current mini program window
: Globally set the mini program window Appearance tabBar
: Set the tabBar
effect at the bottom of the mini program style
: Whether to enable the new version of the component style [ Related learning recommendations: 小program development tutorial】Components of the small program window
window Common configuration items
Property name | Type | Default value | Description | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
String | String | Navigation bar title text content | ||||||||||||||||||||||||||||||||
HexColor | #000000 | Navigation bar background color | ||||||||||||||||||||||||||||||||
String | white | Navigation bar title color, only supports black/white | ||||||||||||||||||||||||||||||||
HexColor | #ffffff | Background color of the window | ||||||||||||||||||||||||||||||||
String | dark | The style of drop-down loading, only supports dark/light | ||||||||||||||||||||||||||||||||
Boolean | false | Whether to enable pull-down refresh globally | ||||||||||||||||||||||||||||||||
Number | 50 | The distance from the bottom of the page when the page pull-to-bottom event is triggered, in px |
Required | Default value | Description | ||
---|---|---|---|---|
No | bottom | The position of tabBar, only supports | bottom | | borderStyle
No | black | The color of the upper border of tabbar, only supports | black | /white
| color
No | ##tabBar Default color for text above (unselected) | selectedColor | ||
No | Default color of text when tabBar is selected | backgroundColor | ||
No | The background color of tabBar | list | ||
is the tab of | tabBar List, minimum 2, maximum 5 |
Required | Description | ##pagePath | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
page path, which must be defined first in pages | text | String | ||||||||||||||||||||||||||||||||
Button text on tab | iconPath | String | ||||||||||||||||||||||||||||||||
Image path, icon size limit is 40kb, the recommended size is 81px * 81px, network images are not supported | selectedIconPath | String | ||||||||||||||||||||||||||||||||
The image when selected Path, icon size is limited to 40kb, recommended size is 81px * 81px, network images are not supported |
Attributes | Type | Default Value | Description |
---|---|---|---|
navigationBarBackgroundColor | HexColor | #000000 | Current navigation Bar background color |
navigationBarTextStyle | String | white | Navigation bar title color, only supports black / white |
navigationBarTitleText | String | ||
HexColor | #ffffff | Background color of the current window | |
String | dark | The style of pull-down loading on the current page, only supports dark/light | |
Boolean | false | Whether to enable pull-down refresh for the current page | |
Number | 50 | Page pull-up bottom event Distance from the bottom of the page when triggered, in px |
The above is the detailed content of In-depth analysis of global configuration in mini programs. For more information, please follow other related articles on the PHP Chinese website!