style(Field): remove word num full color (#6545)

This commit is contained in:
neverland 2020-06-15 21:02:29 +08:00 committed by GitHub
parent 700a0f23f7
commit 35a4b95ef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 11 deletions

View File

@ -497,12 +497,10 @@ export default createComponent({
genWordLimit() { genWordLimit() {
if (this.showWordLimit && this.maxlength) { if (this.showWordLimit && this.maxlength) {
const count = (this.value || '').length; const count = (this.value || '').length;
const full = count >= this.maxlength;
return ( return (
<div class={bem('word-limit')}> <div class={bem('word-limit')}>
<span class={bem('word-num', { full })}>{count}</span>/ <span class={bem('word-num')}>{count}</span>/{this.maxlength}
{this.maxlength}
</div> </div>
); );
} }

View File

@ -151,12 +151,6 @@
text-align: right; text-align: right;
} }
&__word-num {
&--full {
color: @field-word-num-full-color;
}
}
&--error { &--error {
.van-field__control { .van-field__control {
&, &,

View File

@ -74,7 +74,7 @@ exports[`reach max word-limit 1`] = `
<div class="van-cell van-field"> <div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone van-field__value"> <div class="van-cell__value van-cell__value--alone van-field__value">
<div class="van-field__body"><input type="text" class="van-field__control"></div> <div class="van-field__body"><input type="text" class="van-field__control"></div>
<div class="van-field__word-limit"><span class="van-field__word-num van-field__word-num--full">3</span>/3</div> <div class="van-field__word-limit"><span class="van-field__word-num">3</span>/3</div>
</div> </div>
</div> </div>
`; `;

View File

@ -360,7 +360,6 @@
@field-word-limit-color: @gray-7; @field-word-limit-color: @gray-7;
@field-word-limit-font-size: @font-size-sm; @field-word-limit-font-size: @font-size-sm;
@field-word-limit-line-height: 16px; @field-word-limit-line-height: 16px;
@field-word-num-full-color: @red;
@field-disabled-text-color: @gray-5; @field-disabled-text-color: @gray-5;
// GridItem // GridItem