mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* [bugfix] Checkbox border render error in weixin browser * [bugfix] TreeSelect dependency path error * [bugfix] Swipe should clear autoplay timer when destroyed * [bugfix] Optimize component dependency analyze when build style entry * merge * update yarn.lock * update README.md * update README.md * update README.md * update README.md * update README.md * [Doc] add more badges in README.md * update README.md * [bugfix] Address & Contact list style * fix: contact test cases * [bugfix] popup style missing when build style entry * [bugfix] Search: onSearch event arguments missing * [Doc] add demo pages * update zan-doc@0.3.7 * fix: build entry error * [Doc] add goods demo * [bugfix] button primary background color
2.1 KiB
2.1 KiB
Cell
Install
import { Cell, CellGroup } from 'vant';
Vue.component(Cell.name, Cell);
Vue.component(CellGroup.name, CellGroup);
Usage
Basic Usage
:::demo Basic Usage
<van-cell-group>
<van-cell title="Title" value="Text"></van-cell>
<van-cell title="Title" value="Text" label="Description"></van-cell>
</van-cell-group>
:::
Value only
:::demo Value only
<van-cell-group>
<van-cell value="Text"></van-cell>
</van-cell-group>
:::
Left Icon
:::demo Left Icon
<van-cell-group>
<van-cell title="Title" icon="location"></van-cell>
</van-cell-group>
:::
Link
:::demo Link
<van-cell-group>
<van-cell title="Title" is-link></van-cell>
<van-cell title="Title" is-link value="Text"></van-cell>
</van-cell-group>
:::
Advanced Usage
:::demo Advanced Usage
<van-cell-group>
<van-cell value="Text" icon="shop" is-link>
<template slot="title">
<span class="van-cell-text">Title</span>
<van-tag type="danger">Tag</van-tag>
</template>
</van-cell>
<van-cell title="Title" icon="location" is-link></van-cell>
<van-cell title="Title">
<template slot="right-icon">
<van-icon name="search" class="van-cell__right-icon"></van-icon>
</template>
</van-cell>
</van-cell-group>
:::
API
Attribute | Description | Type | Default | Accepted Values |
---|---|---|---|---|
icon | Left Icon | String |
- | - |
title | Title | String |
- | - |
value | Right text | String |
- | - |
label | Description below the title | String |
- | - |
url | Link | String |
- | - |
isLink | Whether to show link icon | Boolean |
false |
- |
required | Whether to show required mark | Boolean |
false |
- |
Slot
name | Description |
---|---|
- | Default slot |
icon | Custom icon |
title | Custom title |
right-icon | Custom right icon |