1、找到項目根目錄的配置文件 app.json,在配置文件中加入配置代碼。例如:
1 "tabBar": { <!--底部的導航配置屬性--> 2 "color": "為選擇時底部導航欄的顏色", 3 "selectedColor": "選中時底部導航欄的顏色", 4 "borderStyle":"底部導航欄邊框樣式", 5 "list": [{ <!--導航配置數組--> 6 "selectedIconPath": "選中時的圖片路徑", 7 "iconPath": "未選中時的圖片路徑", 8 "pagePath": "頁面訪問地址", 9 "text": "首頁" 10 }, { 11 "selectedIconPath": "選中時的圖片路徑", 12 "iconPath": "未選中時的圖片路徑", 13 "pagePath": "頁面訪問地址", 14 "text": "會員" 15 }, { 16 "selectedIconPath": "選中時的圖片路徑", 17 "iconPath": "未選中時的圖片路徑", 18 "pagePath": "頁面訪問地址", 19 "text": "訂單" 20 }] 21 },
具體可參考微信小程序官方文檔。https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html