20161121微信小程序学习笔记-json解析

json 是小程序内的配置文件,用来配置路由,样式的数据内容;

官方demo中给出来默认的json配置项

page = []

page 是路由,是小程序开发总配置的分发器,

"pages": [

    "page/component/index",

    "page/component/component-pages/action-sheet/action-sheet"

]
Paste_Image.png

window = {}

window是全局对象,指的是微信的页面设置;

"window": {

     "navigationBarTextStyle": "black",

    "navigationBarTitleText": "演示",

    "navigationBarBackgroundColor": "#fbf9fe",
}

Paste_Image.png
  • navigationBarTextStyle: 字体样式
  • navigationBarTitleText:文字信息
  • navigationBarBackgroundColor :背景颜色

tabBar = {}

tabBar 是小程序默认的底部通栏,用于切换信息;

"tabBar": {
    "color": "#dddddd",
    "selectedColor": "#3cc51f",
    "borderStyle": "black",
    "backgroundColor": "#ffffff",
    "list": [{
      "pagePath": "page/component/index",
      "iconPath": "image/icon_component.png",
      "selectedIconPath": "image/icon_component_HL.png",
      "text": "组件"
    }, {
      "pagePath": "page/API/index/index",
      "iconPath": "image/icon_API.png",
      "selectedIconPath": "image/icon_API_HL.png",
      "text": "接口"
    }]
  },
Paste_Image.png
  • tabBar直接对应的是其样式;
  • list 是包含数据的数组
    • 用来显示底部的内容
    • pagePath 分发地址
    • iconPath/selectedIconPath 图标选中和默认状态
    • text 文字

networkTimeout = {}

设置网络超时时间

"networkTimeout": {
    "request": 10000,
    "connectSocket": 10000,
    "uploadFile": 10000,
    "downloadFile": 10000
  }

debug :Bealean (true/false)

是够开启调试模式

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • json 是小程序内的配置文件,用来配置路由,样式的数据内容; 官方demo中给出来默认的json配置项 page...
    局部方法阅读 496评论 0 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,948评论 18 139
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,353评论 25 708
  • 昨天看了一下微信小程序官方文档,总结一下自己学习的个人心得. 首先从官方文档给的框架说起,微信小程序官方文档给出了...
    Mr大大大阅读 47,244评论 9 68
  • 今天是此次旅行的第九天。是从云南出发进入西藏的第二天。朋友为了不耽误我的行程(要回去工作),一路赶着开车。途中没...
    札桠阅读 482评论 0 0