Skip to content

单元格 Cell

单元格组件。

兼容性

  • 兼容:✅
  • 不兼容:❌
  • 未知:❔
H5安卓苹果微信支付宝百度抖音QQ快手飞书京东
小红书鸿蒙360华为快应用快应用联盟

插件市场地址

DCloud 插件市场地址

基础使用

  • 通过 title 属性设置标题。
vue
<template>
  <pure-cell title="一个基础的单元格"></pure-cell>
</template>

描述内容

  • 通过 desc 属性设置右侧描述内容。
vue
<template>
  <pure-cell title="带描述内容的单元格" desc="我是描述内容"></pure-cell>
</template>

右侧箭头

  • 通过 arrow 属性设置是否显示右侧箭头。
  • 通过 arrowName 属性设置右侧箭头图标。
  • 通过 arrowRotate 属性设置是否旋转右侧箭头,默认旋转 90deg,可以通过 --pure-cell-arrow-rotate 自定义旋转角度。
vue
<template>
  <pure-cell title="右侧箭头" desc="单元格描述内容" arrow></pure-cell>
  <pure-cell
    title="右侧箭头"
    desc="支持箭头旋转"
    arrow
    :rotate="rotate"
    @onClick="rotate === 90 ? (rotate = 0) : (rotate = 90)"
    tip="点击切换右侧箭头旋转状态"
  ></pure-cell>
</template>

左侧图标

  • 通过 icon 属性设置左侧图标。
vue
<template>
  <pure-cell
    title="带左侧图标的单元格"
    desc="单元格描述内容"
    arrow
    icon="__huiyuan_2"
  ></pure-cell>
</template>

提示内容

  • 通过 tip 属性设置下方显示的提示内容。
vue
<template>
  <pure-cell
    title="带提示内容的单元格"
    desc="单元格描述内容"
    arrow
    icon="__huiyuan_2"
    tip="我是提示内容"
  ></pure-cell>
</template>

边框

  • 通过辅助类 pure-cell-border-toppure-cell-border-bottom 添加单元格上下边框。
vue
<template>
  <pure-cell
    class="pure-cell-border-top"
    title="单元格边框"
    desc="单元格描述内容"
    arrow
    icon="/static/icons/button.png"
    tip="我是提示内容"
  ></pure-cell>
</template>

Props

属性名说明类型默认值可选值版本
hoverClassviewhover-classString"pure-hover"-+1.0.0
icon左侧图标名称String""-+1.0.0
iconMode左侧图片图标的裁剪模式,同图标组件(Icon)的 mode 属性,参考Stringundefined-+1.0.0
title单元格标题[String, Number]""-+1.0.0
desc单元格描述文本[String, Number]""-+1.0.0
tip单元格提示文本[String, Number]""-+1.0.0
arrow是否显示右侧箭头Booleanfalsetrue+1.0.0
arrowIcon右侧箭头图标名称String__you2-+1.0.0
arrowMode右侧箭头图片图标的裁剪模式,同图标组件(Icon)的 mode 属性,参考Stringundefined-+1.0.0
rotate右侧箭头旋转角度[Number, String]00-360+1.0.0
disabled禁用状态Booleanfalsetrue+1.0.0
disabledClass禁用类名Stringpure-disabled-+1.0.0

Event

事件名说明回调参数版本
onClick点击事件-+1.0.0

Slots

名称说明参数版本
default标题+描述-+1.0.0
icon图标-+1.0.0
title标题-+1.0.0
desc描述-+1.0.0
arrow箭头-+1.0.0
tip提示-+1.0.0

基于 MIT 许可发布