文件位置
custom-tab-bar文件夹要与pages文件同级,custom-tab-bar之下的文件名字为index
app.json文件配置
"tabBar": {
// tabBar 第二个B必须大写
"custom": true, // 是否开启自定义tabBar组件
"color": "#999999", // 未选中的文字颜色
"selectedColor": "#00CC99", // 选中的文字颜色
"backgroundColor": "#f1f8f8", // 背景色
"borderStyle": "black", // 边框颜色
"list": [
{
"pagePath": "pages/logs/logs", // 跳转路径
"text": "首页",
"iconPath": "pages/image/homePagew.png", // 未选择时的图标路径
"selectedIconPath": "pages/image/homePage.png" // 选中时的图标路径
},
{
"pagePath": "pages/classification/classification",
"text": "分类",
"iconPath": "pages/image/classificationw.png",
"selectedIconPath": "pages/image/classification.png"
},
{
"pagePath": "pages/cart/cart",
"text": "购物车",
"iconPath": "pages/image/cartw.png",
"selectedIconPath": "pages/image/cart.png"
}