微信小程式頁面不現實Tabbar
阿新 • • 發佈:2019-01-11
有的時候在app.json中定義好了Tabbar,但是頁面卻怎麼也不顯示。
原因:在定義app.json中有page、和tabbar兩個引數
{
"pages":[
"pages/item/item",
"pages/tag/tag",
"pages/discuss/discuss",
"pages/chatting/chatting"
],
"tabBar": {
"color": "#ffffff",
"selectedColor": "#00E5FF",
"backgroundColor": "#607D8B",
"borderStyle ": "#000000",
"list": [
{
"iconPath": "./image/tabbar/item.png",
"selectedIconPath": "./image/tabbar/item_s.png",
"pagePath": "pages/item/item",
"text": "文章"
},
{
"iconPath": "./image/tabbar/tag.png",
"selectedIconPath": "./image/tabbar/tag_s.png",
"pagePath ": "pages/tag/tag",
"text": "標籤"
},
{
"iconPath": "./image/tabbar/discuss.png",
"selectedIconPath": "./image/tabbar/discuss_s.png",
"pagePath": "pages/discuss/discuss",
"text": "討論"
},
{
"iconPath": "./image/tabbar/chatting.png",
"selectedIconPath ": "./image/tabbar/chatting_s.png",
"pagePath": "pages/chatting/chatting",
"text": "分享"
}
]
}
}
原因就在page中的第一個頁面沒在tabbar中。(就這麼簡單的原因)
解決辦法就是把list中的頁面放在page的第一位。