Home  >  Article  >  WeChat Applet  >  WeChat Mini Program Development: Detailed Configuration

WeChat Mini Program Development: Detailed Configuration

高洛峰
高洛峰Original
2017-02-27 13:56:541903browse

1. Global configuration

2. Back to the topic, the app.json file is used to globally configure the WeChat applet, determine the path of the page file, window performance, set network timeout, set multiple tabs, etc. In the introduction of the previous article, I also gave a brief introduction to the app.json file, and then I just read the official document, which introduced it in detail:

微信小程序开发:配置详解

3. Although The official has a detailed analysis, and it is also difficult. I originally wanted to be lazy and just read the official documents, but finally decided to do it all. After all, practice is the only way to verify the truth.

微信小程序开发:配置详解

Follow the documentation

微信小程序开发:配置详解

5.tabBar

If our applet is a For multi-tab applications (there is a tab bar at the bottom of the client window to switch pages), we can use the tabBar configuration item to specify the performance of the tab bar and the corresponding page displayed when the tab is switched. tabBar is an array, and only a minimum of 2 and a maximum of 5 tabs can be configured. The tabs are sorted in the order of the array.

微信小程序开发:配置详解

微信小程序开发:配置详解

##app.json

{
  "pages": [
    "pages/index/index",
    "pages/logs/logs"
  ],
  "window": {
    "backgroundTextStyle": "dark ",
    "navigationBarBackgroundColor": "#ddd",
    "navigationBarTitleText": "配置测试DEMO",
    "navigationBarTextStyle": "black",
    "backgroundColor": "#ff0000"
  },
  "tabBar": {
    "color": "#000000",
    "borderStyle": "black",
    "selectedColor": "#9999FF",
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath": "image/location_normal.png",
        "selectedIconPath": "image/location_selected.png"
      },
      {
        "pagePath": "pages/logs/logs",
        "text": "设置",
        "iconPath": "image/setting_normal.png",
        "selectedIconPath": "image/setting_selecred.png"
      }
    ]
  }
}



More WeChat applet development: detailed configuration explanation For related articles, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn