mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [bugfix] Search box-sizing wrong * [Doc] update vant-demo respo * [Doc] translate theme & demo pages * [Doc] add Internationalization document * [bugfix] remove unnecessary props * [fix] optimize clickoutside * [new feature] optimize find-parent * [new feature]: change document title accordinng to language * [new feature] Pagination code review * [improvement] adjust icon-font unicode * [improvement] Icon spinner color inherit * [improvement] icon default width * [bugfix] DateTimePicker validate date props * [bugfix] Tab item text ellipsis * [improvement] optimize single line ellipsis * [Improvement] optimzie staticClass
61 lines
1.3 KiB
Vue
61 lines
1.3 KiB
Vue
<template>
|
|
<div class="van-cell van-hairline" :class="{ 'van-cell--required': required }" @click="onClick">
|
|
<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" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Icon from '../icon';
|
|
import RouterLink from '../mixins/router-link';
|
|
|
|
export default {
|
|
name: 'van-cell',
|
|
|
|
mixins: [RouterLink],
|
|
|
|
components: {
|
|
[Icon.name]: Icon
|
|
},
|
|
|
|
props: {
|
|
icon: String,
|
|
title: String,
|
|
label: String,
|
|
isLink: Boolean,
|
|
required: Boolean,
|
|
value: [String, Number]
|
|
},
|
|
|
|
methods: {
|
|
onClick() {
|
|
this.$emit('click');
|
|
this.routerLink();
|
|
}
|
|
}
|
|
};
|
|
</script>
|