Some configurations in app.json also support individual page-level settings. You can configure the behavior of a specific page in its corresponding .json file.
Configuration items set in the page-level file override the same items defined in app.json for the current page (style-related items belong to the window property in app.json, but there is no need to explicitly specify the window field in the page configuration). For specific values and definitions, refer to the Global Configuration Documentation.
The file content is a JSON object with the following properties:
Configuration Items
| Attribute | Type | Default | Description | Minimum Version |
|---|---|---|---|---|
| navigationBarBackgroundColor | HexColor | #000000 | The background color of the navigation bar, such as #000000 |
|
| navigationBarTextStyle | string | white | The color of the navigation bar title and status bar. Only black / white are supported |
|
| navigationBarTitleText | string | The text content of the navigation bar title | ||
| navigationStyle | string | default | The style of the navigation bar. Only the following values are supported:default Default stylecustom Custom navigation bar, retaining only the capsule button in the top right corner. |
WeChat client for iOS/Android 7.0.0, Windows/Mac basic library >= v3.6.1 |
| homeButton | boolean | false | Display the home button in the navigation bar for pages that are not the home page, not the bottom of the page stack, or not within the tab bar | WeChat client 8.0.24 |
| backgroundColor | HexColor | #ffffff | The background color of the window | |
| backgroundColorContent | HexColor | #RRGGBBAA | The background color of the page container. Click to view details on setting the background color | |
| backgroundTextStyle | string | dark | The style of the pull-down loading indicator. Only dark / light are supported |
|
| backgroundColorTop | string | #ffffff | The background color of the top window. Supported on iOS only | WeChat client 6.5.16 |
| backgroundColorBottom | string | #ffffff | The background color of the bottom window. Supported on iOS only | WeChat client 6.5.16 |
| enablePullDownRefresh | boolean | false | Whether to enable pull-down refresh for the current page. See Page.onPullDownRefresh for details |
| onReachBottomDistance | number | 50 | The distance from the bottom of the page when the onReachBottom event is triggered, in pixels.
See Page.onReachBottom for details. | |
| pageOrientation | string | portrait | Screen rotation settings. Supports auto / portrait / landscape
See Responsive Display Area Changes for details | 2.4.0 (auto) / 2.5.0 (landscape) |
| disableScroll | boolean | false | If set to true, the entire page cannot be scrolled vertically.
This setting is only valid in the page configuration and cannot be set in app.json | |
| usingComponents | Object | No | Configuration for page custom components | 1.6.3 |
| initialRenderingCache | string | | Configuration for initial rendering cache. Supports static / dynamic / capture | 2.11.1 |
| style | string | default | Enables the new component style | 2.10.2 |
| singlePage | Object | No | Configuration related to single-page mode | 2.12.0 |
| restartStrategy | string | homePage | Restart strategy configuration | 2.8.0 |
| handleWebviewPreload | string | static | Controls the timing of preloading the next page. Supports static / manual / auto | 2.15.0 |
| visualEffectInBackground | string | No | Hides page content when switching to the system background to protect user privacy. Supports hidden / none. If configured separately for a page, it overrides the global configuration. See Global Configuration for details | 2.15.0 |
| enablePassiveEvent | Object or boolean | No | Specifies whether event listeners are passive. If configured separately for a page, it overrides the global configuration. See Global Configuration for details | 2.24.1 |
| renderer | string | No | Rendering backend | 2.30.4 |
| rendererOptions | Object | No | Rendering backend options. See Related Documentation for details | 3.1.0 |
| componentFramework | string | No | Component framework. See Related Documentation for details | 2.30.4 |
- Note: Not all configurations in
app.jsoncan be overridden or specified individually in the page; this is limited to the options included in this document. - Note: For iOS/Android clients prior to version 7.0.0,
navigationStyleis only effective when set inapp.json.
Configuration Example
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "WeChat Interface Feature Demo",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
}