Skip to content

Cell

Cell is used for information display and light interaction. Can be used independently or managed uniformly with wd-cell-group for layout and style.

Component Type

Basic Usage

html
<wd-cell-group>
  <wd-cell title="Title Text" value="Content" />
  <wd-cell title="Title Text" label="Description Info" value="Content" />
</wd-cell-group>

Group Title

html
<wd-cell-group title="Transaction Management" value="Content">
  <wd-cell title="Title Text" value="Content" />
  <wd-cell title="Title Text" label="Description Info" value="Content" />
</wd-cell-group>

Component State

Click Feedback

html
<wd-cell title="Title Text" value="Content" clickable @click="showToast" />

Component Variant

Placeholder

html
<wd-cell-group>
  <wd-cell title="Username" placeholder="Please enter username" />
  <wd-cell title="Phone" value="188****8888" placeholder="Please enter phone" />
  <wd-cell title="Left Align" placeholder="Please enter content" value-align="left" />
  <wd-cell title="Center Align" placeholder="Please enter content" value-align="center" />
</wd-cell-group>
html
<wd-cell-group>
  <wd-cell title="Help & Feedback" is-link to="/pages/index/Index" />
  <wd-cell title="Settings" value="Content" is-link to="/pages/button/Index" replace />
</wd-cell-group>

Arrow Direction

html
<wd-cell-group>
  <wd-cell title="Up Arrow" is-link arrow-direction="up" />
  <wd-cell title="Down Arrow" is-link arrow-direction="down" />
  <wd-cell title="Left Arrow" is-link arrow-direction="left" />
  <wd-cell title="Default Arrow (Right)" is-link />
</wd-cell-group>

Component Style

Icon Settings

Set prefix-icon to use built-in icons, or use prefix slot to customize leading icon.

html
<wd-cell-group>
  <wd-cell title="Title Text" value="Content" prefix-icon="settings" />
  <wd-cell title="Title Text" value="Content">
    <template #prefix>
      <view class="cell-icon"></view>
    </template>
  </wd-cell>
</wd-cell-group>

Large Size

html
<wd-cell-group>
  <wd-cell size="large" title="Title Text" value="Content" />
  <wd-cell size="large" title="Title Text" value="Content" prefix-icon="settings" is-link />
  <wd-cell size="large" title="Title Text" label="Description Info" value="Content" />
</wd-cell-group>

Vertical Center

html
<wd-cell-group>
  <wd-cell title="Title Text" value="Content" center />
  <wd-cell title="Title Text" label="Description Info" value="Content" center />
</wd-cell-group>

Rounded Card Style

html
<wd-cell-group insert>
  <wd-cell title="Title Text" value="Content" />
  <wd-cell title="Title Text" label="Description Info" value="Content" />
</wd-cell-group>

Special Style

Display Border

html
<wd-cell-group title="Transaction Management" border>
  <wd-cell title="Title Text" value="Content" />
  <wd-cell :border="false" title="Title Text" label="This cell doesn't want border" value="Content" />
  <wd-cell title="Title Text" label="Description Info" value="Content" />
</wd-cell-group>

Form Properties

html
<wd-cell-group border>
  <wd-cell title="Required" required>
    <wd-rate v-model="rate" />
  </wd-cell>
  <wd-cell title="Required Star on Right" required asterisk-position="end">
    <wd-rate v-model="rate1" />
  </wd-cell>
  <wd-cell title="Vertical Layout" layout="vertical" required asterisk-position="end">
    <wd-slider v-model="slider" />
  </wd-cell>
</wd-cell-group>

Set Left Width

html
<wd-cell
  title="Title Text"
  label="This is description text, this is description text, this is description text"
  title-width="200px"
  value="Content"
/>

Content Ellipsis

html
<wd-cell-group>
  <wd-cell title="Normal Display" value="This is a very long, very long, very long, very long, very long content" />
  <wd-cell title="Ellipsis Display" value="This is a very long, very long, very long, very long, very long content" ellipsis />
  <wd-cell title="Left Align Ellipsis" value="This is a very long, very long, very long, very long, very long content" value-align="left" ellipsis />
</wd-cell-group>

Custom Content

html
<wd-cell-group>
  <wd-cell title="Title Text" center>
    <wd-button size="small" plain>Button</wd-button>
  </wd-cell>
  <wd-cell title="Title Text" center>
    <wd-switch v-model="switchValue" />
  </wd-cell>
  <wd-cell title="Title Text" is-link to="/pages/index/index">
    <view class="custom-text">Order</view>
  </wd-cell>
  <wd-cell>
    <template #title>
      <view>
        <view style="display: inline-block">Title Text</view>
        <view class="end-time">Expires in 25 days</view>
      </view>
    </template>
  </wd-cell>
</wd-cell-group>

CellGroup Attributes

ParameterDescriptionTypeDefault Value
titleGroup titlestring-
valueGroup right contentstring-
borderWhether to show outer borderbooleanfalse
insertWhether to display as rounded card stylebooleanfalse
centerWhether to center content verticallybooleanfalse
sizeCell size, supports largestring-
title-widthLeft title widthstring | number-
layoutCell layout method, supports horizontal / verticalstring-
value-alignRight content alignment, supports left / right / centerstring-
custom-classRoot node custom class namestring''
custom-styleRoot node custom stylestring''

Cell Attributes

ParameterDescriptionTypeDefault Value
titleLeft titlestring-
valueRight contentstring | number''
placeholderPlaceholder, only displayed when value is emptystring-
labelDescription info below titlestring-
prefix-iconLeading icon namestring-
suffix-iconTrailing icon namestring-
icon-sizeIcon sizestring | number-
icon-prefixIcon class prefixstring-
toNavigation addressstring-
replaceWhether to replace current page history when navigatingbooleanfalse
clickableWhether to enable click feedbackbooleanfalse
is-linkWhether to show right arrow and enable click feedbackbooleanfalse
arrow-directionArrow direction (only effective when is-link is true), supports left / up / down / rightstringright
sizeCell size, supports largestring-
borderWhether to show inner border, priority is higher than cell-group same name attributebooleanInherited from CellGroup
title-widthLeft title widthstring | numberInherited from CellGroup
centerWhether to center verticallybooleanInherited from CellGroup
layoutCell layout method, supports horizontal / verticalstringInherited from CellGroup
value-alignRight content alignment, supports left / right / centerstringInherited from CellGroup
requiredWhether to show required asteriskbooleanfalse
asterisk-positionRequired asterisk position, supports start / endstringstart
hide-asteriskWhether to hide required asteriskbooleanfalse
ellipsisWhether to truncate content with ellipsis when exceedingbooleanfalse
use-title-slotWhether to enable title slotbooleantrue
custom-classRoot node custom class namestring''
custom-styleRoot node custom stylestring''
custom-prefix-classLeading icon custom style classstring''
custom-suffix-classTrailing icon custom style classstring''
custom-label-classLabel area custom style classstring''
custom-value-classValue area custom style classstring''
custom-title-classTitle area custom style classstring''

Cell Events

Event NameDescriptionParameters
clickTriggered when clicking cell when clickable or is-link is true-

CellGroup Slots

nameDescriptionParameters
titleGroup title-
valueGroup right content-

Cell Slots

nameDescriptionParameters
prefixLeading icon area-
titleTitle area-
labelDescription info area-
defaultRight content area-
suffixTrailing icon area (effective when is-link is false)-

主题定制

CSS 变量

组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 ConfigProvider 全局配置

名称默认值描述
--wot-cell-bg$filled-oppo单元格背景色
--wot-cell-bg-active$filled-bottom单元格激活态背景色
--wot-cell-title-color$text-main标题文字颜色
--wot-cell-label-color$text-auxiliary标签文字颜色
--wot-cell-value-color$text-secondary值文字颜色
--wot-cell-icon-color$icon-secondary图标颜色
--wot-cell-theme-color$primary-6主题色
--wot-cell-arrow-color$icon-auxiliary箭头颜色
--wot-cell-border-color$border-main边框颜色
--wot-cell-clear-color$icon-disabled清除图标颜色
--wot-cell-tap-bg$primary-1点击态背景色
--wot-cell-required-color$danger-main必填标记颜色
--wot-cell-placeholder-color$text-placeholder占位符颜色
--wot-cell-arrow-size$n-20箭头图标尺寸
--wot-cell-icon-size$n-20图标尺寸
--wot-cell-title-font-size$typography-body-size-main标题字号
--wot-cell-title-line-height$typography-body-line--height-size-main标题行高
--wot-cell-label-font-size$typography-body-size-main标签字号
--wot-cell-label-line-height$typography-body-line--height-size-main标签行高
--wot-cell-value-font-size$typography-body-size-main值字号
--wot-cell-value-line-height$typography-body-line--height-size-main值行高
--wot-cell-value-font-size-large$typography-body-size-extra-large大尺寸值字号
--wot-cell-value-line-height-large$typography-body-line--height-size-extra-large大尺寸值行高
--wot-cell-title-font-size-large$typography-body-size-extra-large大尺寸标题字号
--wot-cell-title-line-height-large$typography-body-line--height-size-extra-large大尺寸标题行高
--wot-cell-label-font-size-large$typography-body-size-extra-large大尺寸标签字号
--wot-cell-label-line-height-large$typography-body-line--height-size-extra-large大尺寸标签行高
--wot-cell-required-font-size$typography-body-size-main必填标记字号
--wot-cell-required-line-height$typography-body-line--height-size-main必填标记行高
--wot-cell-placeholder-font-size$typography-body-size-main占位符字号
--wot-cell-placeholder-line-height$typography-body-line--height-size-main占位符行高
--wot-cell-padding$padding-loose单元格内边距
--wot-cell-padding-large$padding-extra-loose大尺寸单元格内边距
--wot-cell-vertical-padding-top$padding-extra-loose纵向布局右侧顶部内边距
--wot-cell-required-margin$padding-super-tight必填标记外边距
--wot-cell-icon-spacing-right$spacing-super-tight前缀图标右侧间距
--wot-cell-margin-horizontal$spacing-loose水平布局左右区域间距
--wot-cell-arrow-margin-left$spacing-tight箭头左侧间距
--wot-cell-label-margin-top$spacing-super-tight标签顶部间距

Source Code

Documentation
Component

Released under the MIT License.

Released under the MIT License.