分類
一厨相、pages
用于指定小程序由哪些頁(yè)面組成炼七。
數(shù)組的第一項(xiàng)即為小程序的首頁(yè)傀履,以下首頁(yè)則為pages/index/index
"pages": [
"pages/index/index",
"pages/logs/index"
],
二虱朵、windows
用于設(shè)置小程序的狀態(tài)欄、導(dǎo)航條钓账、標(biāo)題碴犬、窗口背景色。
config.jpg
"window": {
"navigationBarBackgroundColor": "#ffffff", // 導(dǎo)航欄背景顏色梆暮,如 #000000
"navigationBarTextStyle": "black", // 導(dǎo)航欄標(biāo)題顏色服协,僅支持 black / white
"navigationBarTitleText": "導(dǎo)航欄標(biāo)題", // 導(dǎo)航欄標(biāo)題
"backgroundColor": "#eeeeee", // 窗口的背景色
"backgroundTextStyle": "light", // 下拉 loading 的樣式,僅支持 dark / light
"enablePullDownRefresh": true, // 下拉刷新
}
三啦粹、tabbar
如果小程序是一個(gè)多 tab 應(yīng)用(客戶端窗口的底部或頂部有 tab 欄可以切換頁(yè)面)偿荷,可以通過(guò) tabBar 配置項(xiàng)指定 tab 欄的表現(xiàn),以及 tab 切換時(shí)顯示的對(duì)應(yīng)頁(yè)面唠椭。
tabbar.png
"tabBar": {
"color": '#9b9b9b', // tab 上的文字默認(rèn)顏色跳纳,僅支持十六進(jìn)制顏色
"selectedColor": '#FFAD36', // tab 上的文字選中時(shí)的顏色,僅支持十六進(jìn)制顏色
"backgroundColor": '#ffffff', // tab 的背景色贪嫂,僅支持十六進(jìn)制顏色
"list": [{ // tab 的列表寺庄,最少2個(gè)、最多5個(gè) tab
"pagePath": 'pages/home/main', // 頁(yè)面路徑力崇,必須在 pages 中先定義
"text": '首頁(yè)', // tab 上按鈕文字
"iconPath": 'static/img/home.png', // 圖片路徑,有大小限制(40kb)和尺寸建議(81px*81px)
"selectedIconPath": 'static/img/home-active.png' // 選中時(shí)的圖片路徑,限制同上
}, {
"pagePath": 'pages/me/main',
"text": '我的',
"iconPath": 'static/img/me.png',
"selectedIconPath": 'static/img/me-active.png'
}]
}