微信小程序开发(二)小程序全局配置app.json

7 篇文章 0 订阅

文件说明:

app.json : 小程序全局配置

pageswidowstabBarnetworkTimeoutdebug
小程序的全局配置文件,小程序中所有的页面都需要配置路径用于设置小程序的状态栏、导航条、标题、窗口背景色。窗口的底部有tab栏网络请求的超时时间调试模式
array(字符串数组)jsonjsonjsonBoolean
"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的注册页面路由数据更新事件触发
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值