1. 程式人生 > >微信小程式之app.json配置詳細分析

微信小程式之app.json配置詳細分析

app.json配置詳細分析

{
  "pages": [
    "pages/index/index",
    "pages/vultr/vultr"
  ],
  "window": {
    "navigationBarBackgroundColor": "#ff99bb",
    "navigationBarTextStyle": "black",
    "navigationBarTitleText": "小程式",
    "backgroundColor": "#c2f0f0",
    "backgroundTextStyle": "light",
    "enablePullDownRefresh
": true }
, "tabBar": { "color": "#ff99ff", "selectedColor": "#99bbff", "backgroundColor": "#ff4dd2", "borderStyle": "black", "position":"top", "list": [{ "pagePath": "pages/index/index", "text": "首頁", "iconPath": "img/1.png", "selectedIconPath": "img/3.png"
},{ "pagePath": "pages/vultr/vultr", "text": "科學", "iconPath": "img/2.png", "selectedIconPath": "img/3.png" }]
}
, "networkTimeout": { "request": 20000, "connectSocket": 20000, "uploadFile": 20000, "downloadFile": 20000 } }

結構分成4部分

  1. 頁面註冊
  2. 窗體設定
  3. 選單欄設定
  4. 網路延遲設定

頁面註冊

  • 所有頁面的集合構成一個數組,第一個元素為首頁,以此類推!
  • 所有的頁面必須在頁面註冊中註冊!

窗體設定

  • 設定內容為螢幕最上層部分,主要有導航欄、可拉動和拉動時背景設定
  • 導航欄有三個屬性
  • 可拉動有一個
  • 可拉動後的背景顏色設定

選單欄設定

  • 注意事項:若設定了 選單欄 ,首頁 必須是選單欄的成員,否則選單欄失效!

網路延遲設定

  • 主要是對4種請求的延遲設定

作者:Apollo,今日推薦歌曲:容易受傷的女人
微訊號:Xuaning-Smile