页面配置

小于 1 分钟

页面配置

每一个工程页面里面的<config>对本页面的窗口表现进行配置,页面中配置项会覆盖 zmip.config.js 的 window 中相同的配置项,例如:

配置项

用于设置离线包的状态栏、导航条、标题、窗口背景色。

属性类型默认值描述最低版本
navigationBarBackgroundColorHexColor#000000导航栏背景颜色,如#000000
navigationBarTextStylestringwhite导航栏标题颜色,仅支持 black/white
navigationBarTitleTextstring导航栏标题文字内容
navigationStylestringdefault导航栏样式,仅支持以下值:default 默认样式 custom 自定义导航栏,只留右上角胶囊按钮 back 允许小程序容器内 H5 页面返回按钮逐级返回
backgroundColorHexColor#ffffff窗口的背景色

示例代码

<config type='json'>
{
  "navigationBarTitleText": "小程序",
  "navigationStyle": "custom"
}
<config>