pages.json中相关代码介绍
uniapp中tabBar 的设置:
在pages.json中设置tabBar “ 点击(查看相关用法)”
相关tabBar代码:
"tabBar": {
"color": "#7A7E83",
"selectedColor": "#3cc51f",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/component/index",
"iconPath": "static/image/icon_component.png",
"selectedIconPath": "static/image/icon_component_HL.png",
"text": "组件"
}, {
"pagePath": "pages/API/index",
"iconPath": "static/image/icon_API.png",
"selectedIconPath": "static/image/icon_API_HL.png",
"text": "接口"
}]
}
tabBar 中的list数组顺序的调整可以改变显示的位置
pages.json代码中的navigationBarTitleText表示为:若首页未设置title则默认显示为uni-app
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
在pages.json中pages数组中第一项表示应用启动页
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
}
}
,{
"path" : "pages/news/news",
"style" : {