feat(Search): add new external classes field-class、input-class @rex-zsd (#946)

This commit is contained in:
rex 2018-11-24 11:29:33 +08:00 committed by neverland
parent 1186fb24d5
commit f9a9c8ccdc
4 changed files with 7 additions and 3 deletions

View File

@ -83,6 +83,8 @@ Search 支持自定义右侧取消按钮,使用名字为 action 的 slot 即
| 类名 | 说明 | | 类名 | 说明 |
|-----------|-----------| |-----------|-----------|
| custom-class | 根节点样式类 | | custom-class | 根节点样式类 |
| field-class | 搜索框样式类 |
| input-class | 输入框样式类 |
| cancel-class | 取消按钮样式类 | | cancel-class | 取消按钮样式类 |
### 更新日志 ### 更新日志

View File

@ -7,8 +7,9 @@
box-sizing: border-box; box-sizing: border-box;
&__field { &__field {
flex: 1; overflow: hidden;
border-radius: 4px; border-radius: 4px;
flex: 1;
&__left-icon { &__left-icon {
color: @gray-dark; color: @gray-dark;

View File

@ -3,7 +3,7 @@ import { VantComponent } from '../common/component';
VantComponent({ VantComponent({
field: true, field: true,
classes: ['cancel-class'], classes: ['field-class', 'input-class', 'cancel-class'],
props: { props: {
focus: Boolean, focus: Boolean,

View File

@ -10,12 +10,13 @@
error="{{ error }}" error="{{ error }}"
border="{{ false }}" border="{{ false }}"
confirm-type="search" confirm-type="search"
class="van-search__field" class="van-search__field field-class"
value="{{ value }}" value="{{ value }}"
disabled="{{ disabled }}" disabled="{{ disabled }}"
readonly="{{ readony }}" readonly="{{ readony }}"
maxlength="{{ maxlength }}" maxlength="{{ maxlength }}"
input-align="{{ inputAlign }}" input-align="{{ inputAlign }}"
input-class="input-class"
placeholder="{{ placeholder }}" placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }}" placeholder-style="{{ placeholderStyle }}"
custom-style="padding: 3px 10px" custom-style="padding: 3px 10px"