[new feature] Cell: add title-class、value-class、label-class (#2138)

This commit is contained in:
neverland 2018-11-26 10:25:24 +08:00 committed by GitHub
parent 8925d6599a
commit 8dc060e50f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -98,5 +98,9 @@
.van-cell__title {
font-size: 16px;
}
.van-cell__label {
font-size: 14px;
}
}
}

View File

@ -20,20 +20,20 @@
</slot>
<div
v-if="isDef(title) || $slots.title"
:class="b('title')"
:class="[b('title'), titleClass]"
>
<slot name="title">
<span v-text="title" />
<div
v-if="label"
v-text="label"
:class="b('label')"
:class="[b('label'), labelClass]"
/>
</slot>
</div>
<div
v-if="isDef(value) || $slots.default"
:class="b('value', { alone: !$slots.title && !title })"
:class="[b('value', { alone: !$slots.title && !title }), valueClass]"
>
<slot>
<span v-text="value" />
@ -67,13 +67,16 @@ export default create({
props: {
icon: String,
size: String,
label: String,
center: Boolean,
isLink: Boolean,
required: Boolean,
clickable: Boolean,
titleClass: String,
valueClass: String,
labelClass: String,
title: [String, Number],
value: [String, Number],
label: [String, Number],
arrowDirection: String,
border: {
type: Boolean,