文件说明:
app.json : 小程序全局配置
pages | widows | tabBar | networkTimeout | debug |
小程序的全局配置文件,小程序中所有的页面都需要配置路径 | 用于设置小程序的状态栏、导航条、标题、窗口背景色。 | 窗口的底部有tab栏 | 网络请求的超时时间 | 调试模式 |
array(字符串数组) | json | json | json | Boolean |
"pages"
:[
"pages/index/index"
,
"pages/logs/logs"
],
|
"window"
:{
"backgroundTextStyle"
:
"light"
,
"navigationBarBackgroundColor"
:
"#fff"
,
"navigationBarTitleText"
:
"水遁下流之术"
,
"navigationBarTextStyle"
:
"black"
},
|
"tabBar"
:
{
"color"
:
"#a9b7b7"
,
"selectColor"
:
"#eb4f38"
,
"borderStyle"
:
"white"
,
"backgroundColor"
:
"#ffffff"
,
"position"
:
"bottom"
,
"list"
:
[
{
"pagePath"
:
"pages/index/index"
,
"iconPath"
:
"images/index/home.png"
,
"selectedIconPath"
:
"images/index/home-selected.png"
,
"text"
:
"首页"
},
{
"pagePath"
:
"pages/logs/logs"
,
"iconPath"
:
"images/logs/log.png"
,
"selectedIconPath"
:
"images/logs/log-selected.png"
,
"text"
:
"日志"
}
]
},
|
"networkTimeout"
:
{
"request"
:
10000
,
"downloadFile"
:
10000
},
|
"debug"
:
true
|
每一个页面都应包含自己对应的 .wxml,.wxss,.js文件,框架会自己自动合并 | navigationBarBackgroundColor:"#000000"//导航栏背景颜色 navigationBarTextStyle:"white/black" //导航栏标题颜色,仅支持white.black navigationBarTitleText:"导航栏标题内容" //导航栏标题 backgroundColor:"#000000"//窗口背景色 backgroundTextStyle:"dark/light"//下拉背景字体、loading 图的样式,仅支持 dark/light enablePullDownRefresh:true/false //是否开启下拉刷新模式 onReachBottomDistance:50 //页面上拉触底事件触发时距页面底部距离,单位为px |
color:"#ffffff" //tab文字默认颜色 selectedColor:"#000000" //选中tab的文字颜色 backgroundColor:"#f3f3f3" //tab的背景色 list:[{ pagePath:"", //tab页面的路径 iconPath:"",//默认图标地址,<40kb,top时无效 selectedIconPath:""//选中后图标地址,同上 text:"" //tab选项文本 }] //tab页的集合 borderStyle:"black/white"//tab栏上边框颜色 position:"top/bottom" //tab页对齐方式 |
request:10000 //wx.request的超时时间,ms connectSocket:10000 //wx.connectSocket的超时时间,ms uploadFile:10000//wx.uploadFile的超时时间,ms downloadFile:10000 //wx.downloadFile的超时时间,ms |
调试信息有Page的注册 ,页面路由 ,数据更新 ,事件触发 |