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
52 lines
1.2 KiB
Vue
52 lines
1.2 KiB
Vue
<template>
|
|
<a :class="['van-cell', 'van-hairline', { 'van-cell--required': required }]" :href="url" @click="$emit('click')">
|
|
<div class="van-cell__title" v-if="$slots.title || title">
|
|
<slot name="icon">
|
|
<van-icon v-if="icon" :name="icon" />
|
|
</slot>
|
|
<slot name="title">
|
|
<span class="van-cell__text" v-text="title" />
|
|
<span class="van-cell__label" v-if="label" v-text="label" />
|
|
</slot>
|
|
</div>
|
|
<div
|
|
class="van-cell__value"
|
|
v-if="value || $slots.default"
|
|
:class="{
|
|
'van-cell__value--link': isLink,
|
|
'van-cell__value--alone': !$slots.title && !title && !label
|
|
}"
|
|
>
|
|
<slot>
|
|
<span v-text="value" />
|
|
</slot>
|
|
</div>
|
|
<slot name="right-icon">
|
|
<van-icon name="arrow" class="van-cell__right-icon" v-if="isLink" />
|
|
</slot>
|
|
<slot name="extra" />
|
|
</a>
|
|
</template>
|
|
|
|
<script>
|
|
import Icon from '../icon';
|
|
|
|
export default {
|
|
name: 'van-cell',
|
|
|
|
components: {
|
|
[Icon.name]: Icon
|
|
},
|
|
|
|
props: {
|
|
icon: String,
|
|
title: String,
|
|
value: [String, Number],
|
|
url: String,
|
|
label: String,
|
|
isLink: Boolean,
|
|
required: Boolean
|
|
}
|
|
};
|
|
</script>
|