Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Configure the small program


May 17, 2021 WeChat Mini Program Development Document


Table of contents


Global configuration

The app.json file under the root of the small program is used to configure The WeChat program globally, determine the path of the page file, the window performance, set the network timeout, set the multi-tab, and so on.

For a full configuration item description, refer to the small program global configuration

Here's an app.json with some common configuration options:

{
  "pages": [
    "pages/index/index",
    "pages/logs/index"
  ],
  "window": {
    "navigationBarTitleText": "Demo"
  },
  "tabBar": {
    "list": [{
      "pagePath": "pages/index/index",
      "text": "首页"
    }, {
      "pagePath": "pages/logs/index",
      "text": "日志"
    }]
  },
  "networkTimeout": {
    "request": 10000,
    "downloadFile": 10000
  },
  "debug": true,
  "navigateToMiniProgramAppIdList": [
    "wxe5f52902cf4de896"
  ]
}

For a full configuration item description, refer to the small program global configuration

The page configuration

Each small program page can also use the .json file with the same name to configure the window performance of this page, where the configuration items override the same configuration items in app.json's window.

For a full configuration item description, refer to the small program page configuration

For example:

{
  "navigationBarBackgroundColor": "#ffffff",
  "navigationBarTextStyle": "black",
  "navigationBarTitleText": "微信接口功能演示",
  "backgroundColor": "#eeeeee",
  "backgroundTextStyle": "light"
}