1、pages配置项
pages
配置项用于指定当前小程序包含哪些页面(index
/ logs
)
"pages": [
"pages/index/index",
"pages/logs/logs",
"pages/test/test"
],
新建配置项"pages/test/test"
将会在pages
文件夹中新增目录test
, 然后在test
目录中新建"四件套",若写在数组的第一个元素,则会被当做首页展示
2、window配置项
window
配置项用于设置小程序导航栏/标题/窗口的内容及表现样式, object
类型.
"window": {
"backgroundTextStyle": "dark",
"enablePullDownRefresh": true,
"backgroundColor": "#ccc",
"navigationBarBackgroundColor": "#f00",
"navigationBarTitleText": "标题文本",
"navigationBarTextStyle": "white"
},
3、tabbar配置项
tabbar
用于指定小程序的底部选项卡。基本结构如下:
"tabBar": {
"color": "#333",
"selectedColor": "#f00",
"list": [{
"text": "电影",
"pagePath": "pages/index/index",
"iconPath": "/images/index_disable.png",
"selectedIconPath": "/images/index_enable.png"
},{
"text": "影院",
"pagePath": "pages/theatre/theatre",
"iconPath": "/images/theatre_disable.png",
"selectedIconPath": "/images/theatre_enable.png"
},{
"text": "我的",
"pagePath": "pages/me/me",
"iconPath": "/images/me_disable.png",
"selectedIconPath": "/images/me_enable.png"
}]
},
注意事项:
position
若为top
, 则不会显示选项卡的图标。
list
中至少含有2项, 最多5项。
pagePath
不能以/
开头。
iconPath
与selectedIconPath
不支持网络图片路径,只能用本地路径。图标大小建议
81*81
,每张图片不超过40K
。