配置文件 app.json 的重要属性分析 entryPagePath,pages,window,tabBar
pages
- 指定了小程序由哪些页面组成
- 直接粘贴新的路径并编译,可以快速创建新的Page及4个子文件
"pages": [
// 默认第一个路径为首页
"pages/logs/logs",
"pages/index/index",
"pages/homePage/homePage"
],
entryPagePath
- 指定进入小程序后的默认页面,指定的页面 不是首页。
window
- 主要是设置导航栏样式,导航标题文字只有黑、白两个颜色
- 导航栏右上角固定两个按钮
- 页面的下拉刷新也在这里设置 enablePullDownRefresh,下拉刷新也只有两个风格,dark、light
tabbar
- 2 <= list.count <= 5
"tabBar": {
"list": [{
"pagePath": "pages/homePage/homePage",
"text": "hot",
"iconPath": "/images/hot.png",
"selectedIconPath": "/images/hot-active.png"
},{
"pagePath": "pages/index/index",
"text": "index",
"iconPath": "/images/hot-video.png",
"selectedIconPath": "/images/hot-video-active.png"
}
}
网友评论