Cell 单元格

用于各个类别行的信息展示

单元格组件,用于列表项展示,支持标题、描述、图标、箭头、链接跳转等

演示

9:41

代码示例

<!-- 01 组件类型 -->
  <re-cell class="demo-cell-title" title="单行标题" :hover="true" :arrow="true" />
  <re-cell class="demo-cell-required-arrow" title="单行标题" :hover="true" required :arrow="true" />
  <re-cell class="demo-cell-badge" title="单行标题" :hover="true" :arrow="true">
  <re-badge :count="16" />
  <re-cell class="demo-cell-switch" title="单行标题" :hover="true">
  <re-switch :default-value="true" />
  <re-cell class="demo-cell-note-arrow" title="单行标题" :hover="true" note="辅助信息" :arrow="true" />
  <re-cell class="demo-cell-left-icon" title="单行标题" :hover="true" :arrow="true" leftIcon="app" :bordered="false" />
  <re-cell class="demo-cell-desc" title="单行标题" description="一段很长很长的内容文字" :hover="true" :arrow="true" />
  <re-cell class="demo-cell-desc-required" title="单行标题" description="一段很长很长的内容文字" :hover="true" :arrow="true" required />
  <re-cell class="demo-cell-desc-badge" title="单行标题" description="一段很长很长的内容文字" :hover="true" :arrow="true">
  <re-badge :count="16" />
  <re-cell class="demo-cell-desc-switch" title="单行标题" description="一段很长很长的内容文字" :hover="true">
  <re-switch :default-value="true" />
  <re-cell class="demo-cell-desc-note" title="单行标题" description="一段很长很长的内容文字" note="辅助信息" :hover="true" :arrow="true" />
  <re-cell class="demo-cell-desc-icon" title="单行标题" description="一段很长很长的内容文字" leftIcon="app" :hover="true" :arrow="true" />
  <re-cell class="demo-cell-desc-long" title="单行标题" description="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容" :hover="true" />
  <re-cell class="demo-cell-image" title="单行标题" description="一段很长很长的内容文字" align="top" image="https://tdesign.gtimg.com/mobile/demos/avatar1.png" :hover="true" :bordered="false" />

<!-- 02 组件样式 -->
  <re-cell-group class="demo-cell-group-card" theme="card">
  <re-cell title="单行标题" leftIcon="service" :hover="true" :arrow="true" />
  <re-cell title="单行标题" leftIcon="internet" :hover="true" :arrow="true" />
  <re-cell title="单行标题" leftIcon="lock-on" :hover="true" :arrow="true" />

<!-- 03 单元格组 -->
  <re-cell-group class="demo-cell-group-default">
  <re-cell title="单行标题" required />
  <re-cell title="单行标题" :hover="true" note="辅助信息" />
  <re-cell title="单行标题" :hover="true" :arrow="true" />
  <re-cell title="单行标题" :hover="true" note="辅助信息" :arrow="true" />
  <re-cell-group class="demo-cell-group-title" title="分组标题">
  <re-cell title="单行标题" :hover="true" :arrow="true" />
  <re-cell title="单行标题" :hover="true" :arrow="true" />
  <re-cell title="单行标题" :hover="true" :arrow="true" />
  <re-cell-group class="demo-cell-group-bordered" :bordered="true" title="带边框组">
  <re-cell title="单行标题" :hover="true" :arrow="true" />
  <re-cell title="单行标题" :hover="true" :arrow="true" />
  <re-cell-group class="demo-cell-group-no-border" :bordered="false">
  <re-cell title="无边框1" :hover="false" :bordered="false" />
  <re-cell title="无边框2" :hover="false" :bordered="false" />

<!-- 04 对齐方式 -->
  <re-cell class="demo-cell-align-top" title="顶部对齐" note="备注" align="top" />
  <re-cell class="demo-cell-align-middle" title="居中对齐" note="备注" align="middle" />
  <re-cell class="demo-cell-align-bottom" title="底部对齐" note="备注" align="bottom" />

<!-- 05 边框与点击态 -->
  <re-cell class="demo-cell-bordered" title="有边框" />
  <re-cell class="demo-cell-no-border" title="无边框" :bordered="false" />
  <re-cell class="demo-cell-no-hover" title="无点击态" :hover="false" />

<!-- 06 自定义样式 -->
  <re-cell class="demo-cell-custom-style" title="自定义样式" customStyle="margin-top: 10px;" />
  <re-cell class="demo-cell-all" title="完整" description="描述" note="备注" :arrow="true" />
  <re-cell class="demo-cell-empty" />

引入

推荐使用 easycom 模式,配置后无需手动 import 即可直接使用 <re-cell />。

API

Cell Props

名称类型默认值描述必传
titlestring""标题N
descriptionstring""描述文字N
notestring""右侧备注N
imagestring""左侧图片地址N
leftIconstring""左侧图标N
rightIconstring""右侧图标N
borderedbooleantrue是否显示下边框N
hoverbooleantrue是否开启点击态N
arrowbooleanfalse是否显示右侧箭头N
requiredbooleanfalse是否显示必填标记N
alignstring"middle"左右内容垂直对齐方式N
urlstring""点击后跳转链接地址。如果值为空,则表示不需要跳转N
jumpTypestring"navigateTo"链接跳转类型N
rightIconStylestring""右侧图标自定义样式N
customStylestring""自定义样式N
titleStylestring""标题自定义样式N
noteStylestring""说明文字自定义样式N

Cell Events

名称参数描述
click-点击时触发

Cell Slots

名称描述
default默认插槽
image-
title-
description-
value-
note-

CellGroup Props

名称类型默认值描述必传
titlestring""分组标题N
borderedbooleanfalse是否显示组边框N
themestring"default"主题风格,default/cardN
customStylestring""自定义样式N

CellGroup Slots

名称描述
default默认插槽