Skip to content

Page Config

Some configurations in app.json can also be configured for a single page. You can configure the presentation of the current page in the corresponding .json file of the page.

The configuration items in the page will override the same configuration items in app.json for the current page (style-related configuration items belong to the window property in app.json, but the window field does not need to be specified here).

The file content is a JSON object with the following properties:

Configuration Items

PropertyTypeDefaultDescription
navigationBarBackgroundColorHexColor#000000Navigation bar background color, e.g. #000000
navigationBarTextStylestringwhiteNavigation bar title color, status bar color, supports black / white
navigationBarTitleTextstringNavigation bar title text
navigationStylestringdefaultNavigation bar style, supports default / custom
backgroundColorHexColor#ffffffWindow background color
backgroundTextStylestringdarkPull-down loading style, supports dark / light
backgroundColorTopstring#ffffffTop window background color (iOS only)
backgroundColorBottomstring#ffffffBottom window background color (iOS only)
enablePullDownRefreshbooleanfalseWhether to enable pull-down refresh for the current page
onReachBottomDistancenumber50Distance from bottom when reach bottom event triggers, in px
pageOrientationstringportraitScreen orientation, supports auto / portrait / landscape
disableScrollbooleanfalseIf set to true, the page cannot be scrolled vertically
usingComponentsObjectNoPage custom component configuration
initialRenderingCachestringPage initial rendering cache configuration, supports static / dynamic / capture
stylestringdefaultEnable new version of component styles
singlePageObjectNoSingle page mode configuration
restartStrategystringhomePageRestart strategy configuration
handleWebviewPreloadstringstaticControl timing of preloading the next page
visualEffectInBackgroundstringNoHide page content when entering system background to protect user privacy
enablePassiveEventObject/booleanNoWhether event listeners are passive
rendererstringNoRendering backend
rendererOptionsObjectNoRendering backend options
componentFrameworkstringNoComponent framework

Note: Not all configurations in app.json can be overridden or specified individually in the page, only the options included in this document.

Configuration Example

json
{
  "navigationBarBackgroundColor": "#ffffff",
  "navigationBarTextStyle": "black",
  "navigationBarTitleText": "Interface Demo",
  "backgroundColor": "#eeeeee",
  "backgroundTextStyle": "light"
}

usingComponents

Page custom component configuration

json
{
  "usingComponents": {
    "component-tag-name": "path/to/the/custom/component"
  }
}

Released under the Apache-2.0 License.