微信小程序開發(fā)之選項卡(窗口底部TabBar)頁面切換
更新時間:2017年04月12日 09:43:11 作者:dzp_coder
本文主要介紹了微信小程序開發(fā)之選項卡(窗口底部TabBar)頁面切換的相關(guān)知識。具有很好的參考價值。下面跟著小編一起來看下吧
微信小程序開發(fā)中窗口底部tab欄切換頁面很簡單很方便.
代碼:
1.app.json
//app.json { "pages":[ "pages/index/index", "pages/logs/logs" ], "window":{ "backgroundTextStyle":"light", "navigationBarBackgroundColor": "#999999", "navigationBarTitleText": "tab", "navigationBarTextStyle":"white" }, "tabBar": { "color": "#ccc", "selectedColor": "#35495e", "borderStyle": "white", "backgroundColor": "#f9f9f9", "list": [ { "text": "首頁", "pagePath": "pages/index/index", "iconPath": "images/home.png", "selectedIconPath": "images/home-actived.png" }, { "text": "目錄", "pagePath": "pages/catalogue/catalogue", "iconPath": "images/note.png", "selectedIconPath": "images/note-actived.png" }, { "text": "我的", "pagePath": "pages/mine/mine", "iconPath": "images/profile.png", "selectedIconPath": "images/profile-actived.png" } ] } }
pagePath是頁面路徑.iconPath是圖片路徑,icon 大小限制為40kb.
selectedIconPath:選中時的圖片路徑,icon 大小限制為40kb
tab Bar的最多5個,最少2個.
在pages目錄下寫好頁面即可切換.
以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學(xué)習或者工作能帶來一定的幫助,同時也希望多多支持腳本之家!
相關(guān)文章
JavaScript Cookie顯示用戶上次訪問的時間和次數(shù)
用cookies記錄用戶的訪問時間與次數(shù),然后再次訪問時,在讀取。2009-12-12JS中的==運算: [''''] == false —>true
這篇文章主要介紹了JS中的==運算: [''] == false —>true的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-07-07全面解析Bootstrap中nav、collapse的使用方法
這篇文章主要為大家詳細解析了Bootstrap中nav、collapse的使用方法,感興趣的朋友可以參考一下2016-05-05