微信小程序開發(fā)之選項(xiàng)卡(窗口底部TabBar)頁面切換
微信小程序開發(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:選中時(shí)的圖片路徑,icon 大小限制為40kb
tab Bar的最多5個(gè),最少2個(gè).
在pages目錄下寫好頁面即可切換.
以上就是本文的全部內(nèi)容,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作能帶來一定的幫助,同時(shí)也希望多多支持腳本之家!
相關(guān)文章
理解JavaScript設(shè)計(jì)模式中的建造者模式
這篇文章主要介紹了理解JavaScript設(shè)計(jì)模式中的建造者模式,文章基于JavaScript的相關(guān)資料展開箱子內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-04-04JavaScript Cookie顯示用戶上次訪問的時(shí)間和次數(shù)
用cookies記錄用戶的訪問時(shí)間與次數(shù),然后再次訪問時(shí),在讀取。2009-12-12JS中的==運(yùn)算: [''''] == false —>true
這篇文章主要介紹了JS中的==運(yùn)算: [''] == false —>true的相關(guān)資料,非常不錯,具有參考借鑒價(jià)值,需要的朋友可以參考下2016-07-07js 巧妙去除數(shù)組中的重復(fù)項(xiàng)
最近, 我在看YAHOO.util.YUILoader類的源碼, 其中有個(gè)排除數(shù)組重復(fù)項(xiàng)的方法, 讓我覺得甚為巧妙, 這里分享下…2010-01-01全面解析Bootstrap中nav、collapse的使用方法
這篇文章主要為大家詳細(xì)解析了Bootstrap中nav、collapse的使用方法,感興趣的朋友可以參考一下2016-05-05