微信小程序

来源:互联网 发布:apache php 网站发布 编辑:程序博客网 时间:2024/04/30 13:51

小程序配置文件 app.json

  • pages
    页面的路径, 必须填写, 值是页面路径的数组, 如:

    {  "pages": [      "pages/index/index",      "pages/mine/mine"  ]}

    值得注意的是, 页面路径不需要写文件扩展名

  • window
    设置小程序的状态栏, 导航条, 标题, 窗口背景色等系统级样式

    • navigationBarBackgroundColor 导航栏背景色
    • navigationBarTextStyle 仅支持black/white
    • navigationBarTitleText 导航栏文字内容
    • backgroundColor 窗口背景色
    • backgroundTextStyle 下拉背景字体, Loading图样式, 只支持dark/light
    • enablePullDownRefresh 是否开启下拉刷新
  • tabBar
    设置tab的表现

    • color Tab上文字的颜色
    • selectedColor Tab上文字选中的颜色
    • backgroundColor Tab的背景色
    • borderStyle Tab上方边框颜色, 只支持black/white
    • list Tab列表的数组, 最少两个, 最多五个

    list中对象的属性

    • pagePath 页面路径
    • text Tab上的文字
    • iconPath Tab上图标的相对路径
    • selectedIconPath Tab选中时图标的相对路径
    • position Tab在顶部或底部显示, 可选值 bottom top(不好使)
  • networkTimeout
    设置网络超时时间
    • request 设置wx.request的超市时间, 单位毫秒
    • connectSocket 设置wx.connectSocket的超市时间, 单位毫秒
    • uploadFile 设置wx.uploadFile的超市时间, 单位毫秒
    • downloadFile 设置wx.downloadFile的超市时间, 单位毫秒
  • debug
    是否开启调试模式

小程序逻辑文件 app.js

小程序公共样式 app.wxss