底部導航欄
- 當設置 position 為 top 時,將不會顯示 icon
- tabBar 中的 list 是一個數組,只能配置最少2個、最多5個 tab,tab 按數組的順序排序。
- tabbar 切換第一次加載時可能渲染不及時,可以在每個tabbar頁面的onLoad生命周期里先彈出一個等待雪花(hello uni-app使用了此方式)
- tabbar 的頁面展現過一次后就保留在內存中,再次切換 tabbar 頁面,只會觸發每個頁面的onShow,不會再觸發onLoad。
- 頂部的 tabbar 目前僅微信小程序上支持。需要用到頂部選項卡的話,建議不使用 tabbar 的頂部設置,而是自己做頂部選項卡,可參考 hello uni-app->模板->頂部選項卡。
"tabBar":{ "color": "#000000", "selectedColor":"0faeff", "list":[ { "pagePath": "pages/index/index", "iconPath":"static/nav1.png", "selectedIconPath":"static/nav1-a.png", "text":"組件1" },{ "pagePath": "pages/index/index", "iconPath":"static/nav2.png", "selectedIconPath":"static/nav2-a.png", "text":"組件2" } ] }