Page 页面容器
每个页面的最外层容器,集成了导航、Loading组件,对安全区域等做了处理,方便快速实现和统一页面布局。
提示
- 建议每个页面都使用
c-page组件,作为最外层组件。 - 使用本组件时需配置
pages.json并开启自定义导航(参考开发约束)。
平台
| App | 小程序 | H5 |
|---|---|---|
| √ | √ | √ |
属性
| 属性名 | 类型 | 默认值 | 说明 | 平台 |
|---|---|---|---|---|
| title | String,Object | null | 标题 | All |
| titleProps | Object | {} | 标题配置参考c-nav-bar组件的props | All |
| loading | Boolean | false | 加载中 | All |
| loadingProps | Object | {} | loading项配置 参考c-loading-page组件的props | All |
| autoHeight | Boolean | false | 自动高度 | All |
| scroll | Boolean | false | 开启页面滚动 autoHeight=false时有效 | All |
| safeBottom | Boolean | true | 是否显示底部安全距离 | All |
| safeBottomBgColor | String | null | 底部安全距离背景色 | All |
| customTabBar | Boolean,Number,String | false | 是否自定义导航栏 小程序和App端HarmonyOS下有效,为数字/字符串时表示导航栏高度,单位px | All |
| cClass | String,Array,Object | null | 组件类 | All |
| cStyle | String,Array,Object | null | 组件样式 | All |
| margin | String,Number,Array | null | 外边距 | All |
| padding | String,Number,Array | null | 内边距 | All |
| bgColor | String | null | 背景色,支持c-bg-开头的背景色类 | All |
插槽
| 插槽名 | 说明 |
|---|---|
| title | 导航 |
| default |
vue
<template>
<c-page title="首页" bgColor="#000">
<!-- 页面内容 -->
</c-page>
</template>1
2
3
4
5
2
3
4
5
