Heim  >  Artikel  >  WeChat-Applet  >  Einführung in die Konfigurationsmethode der JSON-Konfiguration im WeChat-Applet (mit Code)

Einführung in die Konfigurationsmethode der JSON-Konfiguration im WeChat-Applet (mit Code)

不言
不言Original
2018-08-21 16:45:512891Durchsuche

Dieser Artikel bietet Ihnen eine Einführung in die Konfigurationsmethode der JSON-Konfiguration im WeChat-Applet. Ich hoffe, dass er für Freunde hilfreich ist.

json-Konfiguration kann unterteilt werden in:
1. app.json
1. app.json
app.json-Datei wird verwendet Konfigurieren Sie WeChat. Globale Konfiguration des Miniprogramms

{
  **"pages"**: [
    "pages/index/index",
    "pages/logs/index"
  ],
  //调试快捷键:将鼠标点击到需要调试的页面,按住Alt同时按上键,这时,需要调试的页面就会一行一行的向上移动,直到首页
  **"window"**: {
    "navigationBarBackgroundColor":"#000000",//导航栏背景颜色
    "navigationBarTextStyle":"black",//导航栏标题颜色,仅支持white和black
    "navigationBarTitleText": "XXX",//导航栏标题文字内容
    "backgroundColor":"#ffffff",//窗口的背景色
    "backgroundTextStyle":"dark",//下拉 loading 的样式,仅支持 dark / light
    "enablePullDownRefresh":true,//是否全局开启下拉刷新,true或false
   "onReachBottomDistance":"50px";//页面上拉触底事件触发时距页面底部距离,单位为px。
  },
  **"tabBar"**: {
      "color":"",//文字默认颜色
      "selectedColor":"",//文字选中时的颜色
      "backgroundColor":"",tab的背景色
      "borderStyle":"",//tabbar上边框的颜色, 仅支持 black / white
      "position":"",//tabBar的位置,仅支持 bottom / top
    "list": [
    //最少2个、最多5个 tab
    {
      "pagePath": "pages/index/index",
      "text": "首页",
      "iconPath":"XXXX",
      "selectedIconPath":"XXX"
    }, {
      "pagePath": "pages/logs/logs",
      "text": "日志"
      "iconPath":"XXXX",
      "selectedIconPath":"XXX"
    }]
  },
  //其中 list 接受一个数组,只能配置最少2个、最多5个 tab。tab 按数组的顺序排序,每个项都是一个对象
  **"networkTimeout"**: {
    "request": 60000,//单位毫秒,默认60000
    "uploadFile":60000,//单位毫秒,默认60000
    "downloadFile": 60000//单位毫秒,默认60000
  }
}

2. page.json

{
  "navigationBarBackgroundColor": "#ffffff",//导航栏背景颜色
  "navigationBarTextStyle": "black",//导航栏标题颜色,仅支持 black / white
  "navigationBarTitleText": "微信接口功能演示",//导航栏标题文字内容
  "backgroundColor": "#eeeeee",//窗口的背景色
  "backgroundTextStyle": "light",//下拉 loading 的样式,仅支持 dark / light
  "enablePullDownRefresh":true,//是否全局开启下拉刷新
  "onReachBottomDistance":"50px",//页面上拉触底事件触发时距页面底部距离,单位为px。
  "disableScroll":false//设置为 true 则页面整体不能上下滚动;只在页面配置中有效,无法在 app.json 中设置该项
}

Verwandte Empfehlungen:

Beispielcode für das WeChat-Miniprogramm: Rufen Sie es auf und laden Sie weitere Implementierungen Methoden

Instanzanalyse der Datenbindung im WeChat-Applet (Code)

Das obige ist der detaillierte Inhalt vonEinführung in die Konfigurationsmethode der JSON-Konfiguration im WeChat-Applet (mit Code). Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn