diff --git a/packages/vant/src/search/Search.tsx b/packages/vant/src/search/Search.tsx index f70a9dfa2..be779c07b 100644 --- a/packages/vant/src/search/Search.tsx +++ b/packages/vant/src/search/Search.tsx @@ -125,7 +125,7 @@ export default defineComponent({ v-slots={pick(slots, ['left-icon', 'right-icon'])} ref={fieldRef} type="search" - class={bem('field')} + class={bem('field', { 'with-message': fieldAttrs.errorMessage })} border={false} onBlur={onBlur} onFocus={onFocus} diff --git a/packages/vant/src/search/index.less b/packages/vant/src/search/index.less index f7e7a82e8..e4b556272 100644 --- a/packages/vant/src/search/index.less +++ b/packages/vant/src/search/index.less @@ -48,6 +48,11 @@ .van-field__left-icon { color: var(--van-search-left-icon-color); } + + &--with-message { + height: auto; + align-items: flex-start; + } } &--show-action {