小程序中的配置文件分为两种:

全局配置文件,根目录下的app.json

页面配置文件,每个页面目录下的[page-name].json

app.json

项目配置声明文件(指定项目的一些信息,比如导航栏样式颜色等等)

{  
// 当前程序是由哪些页面组成的(第一项默认为初始页面)  
// 所有使用到的组件或页面都必须在此体现
// https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html#pages 
 "pages": [ ... ], 
 // 应用程序窗口设置  
// https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html#window 
 "window": { ... },  
// 应用导航栏设置  
// https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html#tabBar  
"tabBar": { ... }, 
 // 网络超时设置
  // https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html#networkTimeout  
"networkTimeout": {},  
// 是否在控制台输出调试信息  
// https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html#debug  "debug": true}
登录后复制

[page-name].json

用于指定特定页面工作时,window的设置:

{  
// 导航条背景色  "navigationBarBackgroundColor": "#35495e",  
// 导航条前景色(只能是white/black)  "navigationBarTextStyle": "white",  
// 导航条文本  "navigationBarTitleText": "电影 « 豆瓣", 
 // 窗口背景颜色  "backgroundColor": "#fff",  
// 窗口前景色  "backgroundTextStyle": "dark",  
// 是否开启下拉刷新  "enablePullDownRefresh": true}
登录后复制

以上就是小程序项目基本配置的详细内容,更多请关注慧达安全导航其它相关文章!

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿
发表
评论
返回
顶部