fix(field): fix label-class when use label prop (#3729)

fix #3691
This commit is contained in:
rex 2020-11-04 09:33:38 +08:00 committed by GitHub
parent ba31b465c8
commit ae22e9e80b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,13 +14,14 @@
custom-style="{{ customStyle }}" custom-style="{{ customStyle }}"
arrow-direction="{{ arrowDirection }}" arrow-direction="{{ arrowDirection }}"
custom-class="van-field" custom-class="van-field"
title-class="label-class"
> >
<slot name="left-icon" slot="icon" /> <slot name="left-icon" slot="icon" />
<view wx:if="{{ label }}" class="{{ utils.bem('field__label', { disabled }) }}" slot="title"> <view wx:if="{{ label }}" class="label-class {{ utils.bem('field__label', { disabled }) }}" slot="title">
{{ label }} {{ label }}
</view> </view>
<slot wx:else name="label" slot="title" /> <view wx:else slot="title" class="label-class">
<slot name="label" />
</view>
<view class="{{ utils.bem('field__body', [type]) }}"> <view class="{{ utils.bem('field__body', [type]) }}">
<textarea <textarea
wx:if="{{ type === 'textarea' }}" wx:if="{{ type === 'textarea' }}"