app.json file in the root directory of the mini program is used for global configuration of the mini program. The file content is a JSON object with the following properties:Property | Type | Required | Description |
string | False | The default startup page of the mini program. | |
string[] | True | List of page paths. | |
Object | False | Default global window appearance. | |
Object | False | Tab bar appearance. | |
boolean | False | Whether to enable the debug mode (Disabled by default). | |
Object[] | False | Subpackage structure configuration. | |
string | False | Directory where worker code is placed. | |
string[] | False | ||
Object | False | Subpackage pre-download rules. | |
Object | False | ||
Object | False | Mini program API permission settings. | |
boolean | False | Mini program supports dark mode. | |
string | False | ||
boolean | False | Whether to disable the slide-to-close gesture for the mini program. Default is false. | |
string | False |
{"entryPagePath": "pages/index/index"}
├── app.js├── app.json├── app.wxss├── pages│ │── index│ │ ├── index.wxml│ │ ├── index.js│ │ ├── index.json│ │ └── index.wxss│ └── logs│ ├── logs.wxml│ └── logs.js└── utils
{"pages": ["pages/index/index", "pages/logs/logs"]}
Property | Type | Default value | Description |
navigationBarBackgroundColor | HexColor | #000000 | Sets the background color of the navigation bar, for example, #000000 |
navigationBarTextStyle | string | white | Sets the navigation bar title and status bar color, supporting black and white. |
navigationBarTitleText | string | - | Sets the navigation bar title text. |
navigationStyle | string | default | Sets the navigation bar style: default: default style, including the native navigation bar and capsule button. custom: a custom navigation bar that only keeps the capsule button in the top right corner. This doesn’t take effect on pages containing a web-view . hide: hides both the navigation bar and the capsule button. On pages containing a web-view , only the capsule button is hidden. customV2: a custom navigation bar that only keeps the capsule button in the top right corner. hideV2: hides both the navigation bar and the capsule button. Refer to Note 2 and Note 3 right after the table. |
backgroundColor | HexColor | #ffffff | Sets the window background color. |
backgroundTextStyle | string | dark | The pull-down loading style only supports dark or light. |
backgroundColorTop | string | #ffffff | Top window background color, supported only on iOS. |
backgroundColorBottom | string | #ffffff | Bottom window background color, supported only on iOS. |
enablePullDownRefresh | boolean | false | Whether to enable pull-down refresh. |
onReachBottomDistance | number | 50 | The distance (in px) from the bottom of the page when the pull-to-refresh event is triggered. |
customNavigateBack | Boolean | false | Whether to intercept the default page back action (such as clicking the tabBar back button, swiping, or pressing the back key) in conjunction with Page.onCustomBack. |
pageOrientation | string | portrait | Screen rotation settings support auto, portrait, and landscape modes. |
navigationStyle, the minimum version requirements for customV2 and hideV2 are as follows:IDE | Base library | SDK for iOS | SDK for Android |
2.2.611 | 2.2.6 | 2.2.6 | 2.2.6 |
navigationStyle are as follows:navigationStyle | Regular page | Page containing a web-view |
default | ![]() | ![]() |
custom | ![]() | ![]() |
hide | ![]() | ![]() |
customV2 | ![]() | ![]() |
hideV2 | ![]() | ![]() |
Property | Type | Required | Default value | Description |
color | HexColor | True | - | The default color of the text on the tab. Only hexadecimal colors are supported. |
selectedColor | HexColor | True | - | The color of the texts on the tab when they are selected. Only hexadecimal colors are supported. |
backgroundColor | HexColor | True | - | The background color of the tab. Only hexadecimal colors are supported. |
borderStyle | string | False | black | The color of the top border on the tabBar can only be set to black or white. |
list | Array | True | - | The list of tabs. For details, see the description of the list attribute. A maximum of 5 tabs and a minimum of 2 tabs are allowed. |
position | string | False | bottom | The position of tabBar can only be set to bottom or top. |
custom | boolean | False | false |
Property | Type | Required | Description |
pagePath | string | True | Page path, which must be defined in pages first. |
text | string | True | Button text on the tab. |
iconPath | string | False | Image path. The upper limit of the icon size is 40 KB, and the recommended pixel size is 81 px × 81 px. Network images are not supported. When position is set to top, the icon is not displayed. |
selectedIconPath | string | False | The image path when the icon is selected. The upper limit of the icon size is 40 KB, and the recommended pixel size is 81 px × 81 px. Network images are not supported. When position is set to top, the icon is not displayed. |

debug mode in the IDE. In the console panel, debug information will be provided as info , including details on page registration, page routing, data updates, and event triggers. It helps developers quickly troubleshoot some common problems.app.json are considered global custom components and can be used directly in pages or custom components within the mini program without further declaration. It is recommended to only declare custom components that are used by almost all pages.Object. Its structure is as follows:Property | Type | Required | Default value | Description |
scope.userLocation | PermissionObject | False | - | Declaration of location-related permissions. |
Property | Type | Required | Default value | Description |
desc | string | True | - | The description of the API displayed when requesting permissions in the mini program (in Chinese). Max 80 characters. |
desc-en | string | False | - | The description of the API displayed when requesting permissions in the mini program (in English). Max 80 characters. |
desc-ar | string | False | - | The description of the API displayed when requesting permissions in the mini program (in Arabic). Max 80 characters. |
{"pages": ["pages/index/index"],"permission": {"scope.userLocation": {"desc": "The mini program will display the location API based on your location information" // Continuous location tracking in the backend during highway driving}}}
scope | APIs | Description |
scope.userInfo | wx.getUserInfo | User information. |
scope.userLocation | wx.getLocation | Gets geographic location information. |
scope.userFuzzyLocation | wx.getFuzzyLocation | Gets approximate geographic location information. |
scope.record | live-pusher component or wx.startRecord | Live streaming or recording. |
scope.camera | Camera component | Camera component. |
scope.addPhoneCalendar | wx.addPhoneCalendar | Adds logs. |
scope.writePhotosAlbum | wx.saveImageToPhotosAlbum | Saves images to an album. |
scope.bluetooth | wx.openBluetoothAdapter | Bluetooth. |
scope.chooseMessageFile | wx.chooseMessageFile wx.chooseExternalFile | Selects a file from the client session. Selects a file from the mobile file picker. |
scope.getPhoneNumber | button component open-type="getPhoneNumber" | Gets the phone number. |
scope.getEmail | button component open-type="getEmailAddress" | Gets the email address. |
scope.chooseImage | wx.chooseImage | Selects images from the local photo album or take photos using the camera. |
scope.chooseVideo | wx.chooseVideo | Records a video or selects a video from the phone's album. |
scope.chooseMedia | wx.chooseMedia | Captures or selects images or videos from the phone's album. |
"darkmode": true, you can enable dark mode in the mini program. All basic components will display different default styles according to the system theme, and the navigation bar and tab bar will also automatically switch according to the developer's configuration.{"darkmode": true}
{"apiVersion": "v1"}
{"pages": ["pages/index/index", "pages/logs/index"],"window": {"navigationBarTitleText": "Demo"},"tabBar": {"list": [{"pagePath": "pages/index/index","text": "Homepage"},{"pagePath": "pages/logs/logs","text": "Log"}]},"debug": true}
Feedback