微信小程序tabBar不生效
發表時間:2022-9-14
發布人:葵宇科技
瀏覽次數:23
配置如下:
{
"pages": [
"pages/index/index",
"pages/mine/mine"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "活動寶",
"navigationBarTextStyle": "black"
},
"tabBar": {
"backgroundColor": "#202020",
"color": "#fff",
"list": [
{
"selectedIconPath": "images/ic_index2.png",
"iconPath": "images/ic_index1.png",
"text": "首頁",
"backgroundColor": "#dddddd",
"pagePath":"page/index/index"
},
{
"selectedIconPath": "images/ic_mine2.png",
"iconPath": "images/ic_mine1.png",
"text": "我的",
"backgroundColor": "#dddddd",
"pagePath": "page/mine/mine"
}
]
}
}
效果圖出不來的原因在于:
pagePath節點配置錯誤,但工具又沒有報錯。正確的應該為:
"pagePath": "pages/mine/mine"