CellGroup 单元格组
本组件用于包裹c-cell组件,并可对c-cell组件进行统一配置。
平台
| App | 小程序 | H5 |
|---|---|---|
| √ | √ | √ |
属性
| 属性名 | 类型 | 默认值 | 说明 | 平台 |
|---|---|---|---|---|
| title | String,Object | null | 标题 为Object时,参考c-text的props | All |
| titleProps | Object | {} | 标题配置,参考c-text的props | All |
| desc | String,Object | null | 描述 | All |
| descProps | Object | {} | 描述配置,参考c-text的props | All |
| icon | String,Object | null | 标题前的icon 为Object时,参考c-icon的props | All |
| iconProps | Object | {} | icon的配置,参考c-icon的props | All |
| rightText | String,Object | null | 右侧的icon,默认为右箭头 为Object时,参考c-icon的props | All |
| rightIcon | Boolean,String,Object | false | 右侧的icon,默认为右箭头 为Object时,参考c-icon的props | All |
| rightRoute | String,Object,Array | null | 右侧路由跳转 参考uni.$c.route()参数 | All |
| headerProps | Object | {} | 头部样式 参考c-box的props | All |
| bodyProps | Object | {} | 底部样式 参考c-box的props | All |
| hideLastCellBorder | Boolean | true | 是否隐藏最后一个cell的下边框 | All |
| cellProps | Object | {} | 子元素的公共配置 可用配置有: labelProps,valueProps,placeholderProps,descProps,icon,iconProps,rightIcon,rightIconProps,hover,hoverClass,border,bgColor,padding,margin,cStyle,cClass | 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 |
事件
| 事件名 | 说明 | 平台 |
|---|---|---|
| rightClick | 标题右侧点击事件 | All |
| click(name) | c-cell统一点击事件,返回被点击单元格的name | All |
插槽
| 插槽名 | 说明 | 平台 |
|---|---|---|
| icon | 标题前的icon插槽 | All |
| desc | 标题后的描述插槽 | All |
| right | 右侧插槽 | All |
| default | All |
示例
vue
<template>
<c-cell-group title="标题" @click="onCellClick">
<c-cell name="1" label="单元格1" value="内容" />
<c-cell name="2" label="单元格2" rightIcon />
</c-cell-group>
</template>
<script setup>
function onCellClick(name) {
console.log('点击了', name)
}
</script>1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
