跳到主要内容

CellGroup 单元格组 ​

uni-appH5微信小程序App

为多个 Cell 提供标题、背景和分组边界。

何时使用 ​

设置页等需要把单元格按主题分组的场景。

何时不使用 ​

单个单元格无需分组,直接用 Cell。

本文档为 uni-app 端组件契约;Web 端同名组件 API 可能略有差异,请以对应包文档为准。下方手机预览实时运行 uni-app H5 演示。

9:41
CellGroup 单元格组 · uni-app H5 实时运行 新窗口打开

Props ​

名称类型默认值说明
titlestring""组标题(13px secondary 色)
insetbooleanfalse内缩圆角卡片样式,iOS 分组列表外观

Slots ​

名称说明
defaultCell 子项

示例 ​

标准分组 ​

vue
<CellGroup title="个人信息">
  <Cell title="头像" value="已设置" arrow />
  <Cell title="昵称" value="Ruanno" arrow />
  <Cell title="签名" value="一套代码,跑遍三端" arrow />
</CellGroup>

卡片圆角(inset) ​

vue
<CellGroup title="我的服务" inset>
  <Cell title="我的订单" arrow />
  <Cell title="优惠券" value="3 张" arrow />
  <Cell title="客服中心" arrow />
</CellGroup>

多组并列 ​

vue
<CellGroup title="账户">
  <Cell title="余额" value="¥128.00" />
</CellGroup>
<CellGroup title="资产" style="margin-top:12px">
  <Cell title="优惠券" value="3 张" arrow />
  <Cell title="积分" value="1200" arrow />
</CellGroup>