逆战工程

1、配置文件
1.1 全局配置 app.json

{
“pages”:[
“pages/index/index”,
“pages/home/index”,
“pages/cart/index”,
],
“window”:{
“backgroundTextStyle”:“light”,
“navigationBarBackgroundColor”: “#ff6666”,
“navigationBarTitleText”: “嗨购”,
“navigationBarTextStyle”:“black”
},
“tabBar”: {
“color”: “#333”,
“selectedColor”: “#f66”,
“backgroundColor”: “#efefef”,
“list”: [
{
“pagePath”: “pages/home/home”,
“text”: “首页”,
“iconPath”: “resources/home.png”,
“selectedIconPath”: “resources/home_active.png”
},
{
“pagePath”: “pages/kind/kind”,
“text”: “分类”,
“iconPath”: “resources/kind.png”,
“selectedIconPath”: “resources/kind_active.png”
},
]
}

简单的说一下上面那些字段的含义

  1. pages 字段 — 是用于描述当前小程序所有页面的路径,这是为了让微信客户端知道当前你的小程序页面定义在哪个目录
  2. window 字段 — 定义小程序所有页面的顶部背景颜色,文字颜色定义等。
  3. 完整的请参考(https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html).
  4. tabbar图片表示把(注意:tabbar里面list最少2个,最多五个)
    简单小图

这里的 page.json 其实就是用来表示页面目录下的 page.json 这类和小程序相关的配置
开发者可以独立定义每个页面的一些属性,如顶部颜色、是否允许下拉刷新等待
页面的配置只能设置 app.json 中部分 window 配置项的内容,页面中配置项会覆盖全局 app.json 的 window中相同的配置项
1
————————————————
版权声明:本文为CSDN博主「Ayabeni?」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Hzz66/article/details/104459014

配置项(此列表转之微信小程序官网列表,如有侵权,联系删除)
属性 类型 默认值 描述 最低版本
navigationBarBackgroundColor HexColor #000000 导航栏背景颜色,如 #000000
navigationBarTextStyle string white 导航栏标题颜色,仅支持 black / white
navigationBarTitleText string 导航栏标题文字内容
navigationStyle string default 导航栏样式,仅支持以下值:
default 默认样式
custom 自定义导航栏,只保留右上角胶囊按钮 微信客户端 7.0.0
backgroundColor HexColor #ffffff 窗口的背景色
backgroundTextStyle string dark 下拉 loading 的样式,仅支持 dark / light
backgroundColorTop string #ffffff 顶部窗口的背景色,仅 iOS 支持 微信客户端 6.5.16
backgroundColorBottom string #ffffff 底部窗口的背景色,仅 iOS 支持 微信客户端 6.5.16
enablePullDownRefresh boolean false 是否开启当前页面下拉刷新。
详见 Page.onPullDownRefresh
onReachBottomDistance number 50 页面上拉触底事件触发时距页面底部距离,单位为px。

发布了1 篇原创文章 · 获赞 0 · 访问量 5

猜你喜欢

转载自blog.csdn.net/kangLinYan/article/details/104467187
今日推荐