底部tabBar配置 - 在pages.json中
图标可以到阿里图标库下载,例如下载首页图标,直接搜“首页”,然后找对应的图标,点进去,选择颜色,下载下来就是png格式的图片
{
"pages": [ ],
"globalStyle": {},
"uniIdRouter": {},
"tabBar": {
// 底部导航栏颜色 未选中文字状态
"color": "#333",
// 底部导航栏颜色 选中文字状态
"selectedColor": "#015ff9",
"list": [
{
"text": "首页",
"pagePath": "pages/index/index",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home-h.png"
},
{
"text": "新闻列表",
"pagePath": "pages/list/list",
"iconPath": "static/images/tabbar/list.png",
"selectedIconPath": "static/images/tabbar/list-h.png"
},
{
"text": "我们",
"pagePath": "pages/about/about",
"iconPath": "static/images/tabbar/user.png",
"selectedIconPath": "static/images/tabbar/user-h.png"
}
]
}
}