内容摘要:pages 用于指定小程序由哪些页面组成,每一项都对应一个页面的 路径+文件名 信息。文件名不需要写文件后缀,框架会自动去寻找对于位置的 .json , .js , .wxml , .wxss 四个文件进行处理。...
用于指定小程序由哪些页面组成,每一项都对应一个页面的 路径+文件名 信息。文件名不需要写文件后缀,框架会自动去寻找对于位置的 .json
, .js
, .wxml
, .wxss
四个文件进行处理。
数组的第一项代表小程序的初始页面(首页)。小程序中新增/减少页面,都需要对 pages 数组进行修改。
如开发目录为:
├── app.js
├── app.json
├── app.wxss
├── pages
│ │── index
│ │ ├── index.wxml
│ │ ├── index.js
│ │ ├── index.json
│ │ └── index.wxss
│ └── logs
│ ├── logs.wxml
│ └── logs.js
└── utils
则需要在 app.json 中写
{
"pages": ["pages/index/index", "pages/logs/logs"]
}
用于设置小程序的状态栏、导航条、标题、窗口背景色。
属性 | 类型 | 默认值 | 描述 | 最低版本 |
---|---|---|---|---|
navigationBarBackgroundColor | HexColor | #000000 |
导航栏背景颜色,如 #000000 |
|
navigationBarTextStyle | String | white |
导航栏标题颜色,仅支持 black / white |
|
navigationBarTitleText | String | 导航栏标题文字内容 | ||
navigationStyle | String | default |
导航栏样式,仅支持以下值:default 默认样式custom 自定义导航栏,只保留右上角胶囊按钮。参见注2。 |
微信客户端 6.6.0 |
backgroundColor | HexColor | #ffffff | 窗口的背景色 | |
backgroundTextStyle | String | dark |
下拉 loading 的样式,仅支持 dark / light |
|
backgroundColorTop | String | #ffffff | 顶部窗口的背景色,仅 iOS 支持 | 微信客户端 6.5.16 |
backgroundColorBottom | String | #ffffff | 底部窗口的背景色,仅 iOS 支持 | 微信客户端 6.5.16 |
enablePullDownRefresh | Boolean | false |
是否开启当前页面的下拉刷新。 详见 Page.onPullDownRefresh |
|
onReachBottomDistance | Number | 50 |
页面上拉触底事件触发时距页面底部距离,单位为px。 详见 Page.onReachBottom |
|
pageOrientation | String | portrait |
屏幕旋转设置,支持 auto / portrait / landscape 详见 响应显示区域变化 |
微信客户端 6.7.3 (auto) / 6.7.4 (landscape) |
navigationStyle
navigationStyle
只在 app.json
中生效。navigationStyle: custom
对 <web-view>
组件无效如 app.json :
{
"window": {
"navigationBarBackgroundColor": "#ffffff",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "微信接口功能演示",
"backgroundColor": "#eeeeee",
"backgroundTextStyle": "light"
}
}
咨询客服
蓝典客服热线
284028140
添加客服微信
扫码关注
公众号:蓝典网络
(landianwl)
关注蓝典公众号