# Page configuration
Each Mini Program page can also be used .json
File to configure the window presentation for this page. The configuration item in the page overrides the current page app.json
of window
The same configuration item in. The file content is a JSON Object has the following properties
# Configuration item
attribute | type | Default value | describe | Minimum version |
---|---|---|---|---|
navigationBarBackgroundColor | HexColor | #000000 | Navigation bar background color, such as #000000 | |
navigationBarTextStyle | string | white | Navigation bar header color, support only black / white | |
navigationBarTitleText | string | Navigation Title Text Content | ||
navigationStyle | string | default | Navigation bar style supports only the following valuesdefault Default Stylecustom Customize the navigation bar, leaving only the capsule on in the upper right corner. See note 1。 | iOS/Android WeChat Client 7.0.0,Windows The client is not supported. |
backgroundColor | HexColor | #ffffff | The background color of the window | |
backgroundTextStyle | string | dark | Pull down loading Style, only supports dark / light | |
backgroundColorTop | string | #ffffff | The background color of the top window, only iOS Support | WeChat Client 6.5.16 |
backgroundColorBottom | string | #ffffff | The background color of the bottom window, only iOS Support | WeChat Client 6.5.16 |
enablePullDownRefresh | boolean | false | Whether to enable the current page drop-down refresh. See for details Page.onPullDownRefresh | |
onReachBottomDistance | number | 50 | The distance, in px, from the bottom of the page when the pull-down event is triggered. See for details Page.onReachBottom | |
pageOrientation | string | portrait | Screen rotation settings, support car / portrait / landscape See for details Response to display area changes | 2.4.0 (car) / 2.5.0 (landscape) |
disableScroll | boolean | false | Set to true The page cannot scroll up and down as a whole.Valid only in page configuration, not in app.json Set in | |
usingComponents | Object | no | pageCustom component configuration | 1.6.3 |
InitialRenderingCache | string | pageInitial Render Cache configuration | 2.11.1 | |
style | string | default | Enable new component styles | 2.10.2 |
singlePage | Object | no | Single-page mode correlation configuration | 2.12.0 |
Page configuration can only set
app.json
inwindow
Corresponding configuration items to determine the window performance of this page, so there is no need to writewindow
This property.
- notes 1: About
navigationStyle
- iOS/Android client 7.0.0 The following version,
navigationStyle
Only inapp.json
In effect. - iOS/Android client 6.7.2 Version starts,
navigationStyle: custom
Yes web-view Invalid component - open custom After the lower version of the client needs to do a good job of compatibility. Developer Tools Base Library Version Cut to 1.7.0 (does not represent the lowest version, only for debugging purposes) can easily cut to the old vision
- Windows client 3.0 And above versions, in order to provide users with more consistent desktop software experience, unified the Mini Program window navigation bar,
navigationStyle: custom
No longer valid
- iOS/Android client 7.0.0 The following version,
# singlePage
Base library 2.11.3 And above, currentlyShare to your friends (Beta) Open later and enter single page mode
Single-page mode correlation configuration
attribute | type | Required | Default value | describe |
---|---|---|---|---|
navigationBarFit | String | no | If the original page is a custom navigation bar; otherwise Float, otherwise squeezed | The intersection of the navigation bar and the page, with a value of float Indicates that the navigation bar floats on the page and intersects the pageValue is squeezed Means that the page is squeezed by the navigation bar and does not intersect with the page |
# Configuration sample
{
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "WeChat interface function demonstration,"
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
}