{ "pages": [ //pages數組中第一項表示應用啟動頁,參考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { "navigationBarTitleText": "組件" } }, { "path": "pages/index/index1", "style": { "navigationBarTitleText": "接口" } } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, "tabBar": { "color": "#7A7E83", "selectedColor": "#3cc51f", "borderStyle": "black", "backgroundColor": "#ffffff",
//注意標紅出,不要去改為相對路徑,下面這個就是錯誤的示范,無法顯示出tabBar "list": [{ "pagePath": "./pages/index/index", "iconPath": "/static/1.png", "selectedIconPath": "/static/2.png", "text": "組件" }, { "pagePath": "./pages/index/index1", "iconPath": "/static/3.png", "selectedIconPath": "/static/4.png", "text": "接口" }] } }
修改之后:
{ "pages": [ //pages數組中第一項表示應用啟動頁,參考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { "navigationBarTitleText": "組件" } }, { "path": "pages/index/index1", "style": { "navigationBarTitleText": "接口" } } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, "tabBar": { "color": "#7A7E83", "selectedColor": "#3cc51f", "borderStyle": "black", "backgroundColor": "#ffffff",
//要修改成與pages里面path的路徑一樣,點擊保存就能正常顯示了 "list": [{ "pagePath": "pages/index/index", "iconPath": "/static/1.png", "selectedIconPath": "/static/2.png", "text": "組件" }, { "pagePath": "pages/index/index1", "iconPath": "/static/3.png", "selectedIconPath": "/static/4.png", "text": "接口" }] } }