feat(Field): update disabled style (#3358)

This commit is contained in:
neverland 2020-07-09 15:39:18 +08:00 committed by GitHub
parent da4a5f3cd4
commit abd0457238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -238,7 +238,7 @@
@field-label-margin-right: @padding-sm;
@field-input-text-color: @text-color;
@field-input-error-text-color: @red;
@field-input-disabled-text-color: @gray-6;
@field-input-disabled-text-color: @gray-5;
@field-placeholder-text-color: @gray-5;
@field-icon-size: 16px;
@field-clear-icon-size: 16px;
@ -251,6 +251,7 @@
@field-word-limit-font-size: @font-size-sm;
@field-word-limit-line-height: 16px;
@field-word-num-full-color: @red;
@field-disabled-text-color: @gray-5;
// GoodsAction
@goods-action-background-color: @white;

View File

@ -7,6 +7,10 @@
&__label {
.theme(color, '@field-label-color');
.theme(margin-right, '@field-label-margin-right');
&--disabled {
.theme(color, '@field-disabled-text-color');
}
}
&__body {

View File

@ -16,7 +16,7 @@
title-class="label-class"
>
<slot name="left-icon" slot="icon" />
<view wx:if="{{ label }}" class="van-field__label" slot="title">
<view wx:if="{{ label }}" class="{{ utils.bem('field__label', { disabled }) }}" slot="title">
{{ label }}
</view>
<slot wx:else name="label" slot="title" />
@ -33,7 +33,7 @@
maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }}"
placeholder-class="{{ utils.bem('field__placeholder', { error }) }}"
placeholder-class="{{ utils.bem('field__placeholder', { error, disabled }) }}"
auto-height="{{ !!autosize }}"
style="{{ computed.inputStyle(autosize) }}"
cursor-spacing="{{ cursorSpacing }}"