通过globalStyle进行全局配置
用于设置应用的状态栏、导航条、标题、窗口背景色等
以上是几个常用的属性,附上颜色查询表:
http://destiny001.gitee.io/color/
页面配置重头戏:tabBar
tabBar 中的 list 是一个数组,只能配置最少2个、最多5个 tab,tab 按数组的顺序排序。
其中 list 接收一个数组,数组中的每个项都是一个对象
来点小把式:
注意h5的使用,tab的icon和icon-active的使用
"pages": [ //pages数组中第一项表示应用启动页,参考: "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/message/message",
"style": {
"navigationBarTitleText": "信息页",
"navigationBarBackgroundColor":"#98FB98",
"h5":{
"pullToRefresh": {
"color":"#9370DB"
}
}
}
},
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"tabBar":{
"list":[{
"text":"首页",
"pagePath":"pages/index/index",
"iconPath": "static/tabs/home.png",
"selectedIconPath": "static/tabs/home-active.png"
},
{
"text":"信息页",
"pagePath":"pages/message/message",
"iconPath": "static/tabs/message.png",
"selectedIconPath": "static/tabs/message-active.png"
}
]
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "love you",
"navigationBarBackgroundColor": "#B9D3EE",
"backgroundColor": "#9FB6CD",
"enablePullDownRefresh":true
}
另外需要说明的是:
在看文档的时候,注意哪些属性是 同级
condition启动模式配置
这个模式有啥作用呢?
我的理解是 其实就是进入一个没有入口的文件
比如从列表页进入详情页,是要传id的,根据id来展示不同的数据。
可以用query配置上一个页面传递过来的参数,这个具体后续再说
现在配置一下condition,是可以让我们在微信开发者工具拿到一个页面参数