diff --git a/packages/search/README.md b/packages/search/README.md index e8e84c64..6f082c5e 100644 --- a/packages/search/README.md +++ b/packages/search/README.md @@ -72,6 +72,10 @@ | placeholder | 输入框为空时占位符 | *string* | - | - | | placeholder-style | 指定占位符的样式 | *string* | - | - | | input-align | 输入框内容对齐方式,可选值为 `center` `right` | *string* | `left` | - | +| use-left-icon-slot | 是否使用输入框左侧图标 slot | *boolean* | `false` | - | +| use-right-icon-slot | 是否使用输入框右侧图标 slot | *boolean* | `false` | - | +| left-icon | 输入框左侧图标名称或图片链接,可选值见 Icon 组件(如果设置了use-left-icon-slot,则该属性无效) | *string* | `search` | - | +| right-icon | 输入框右侧图标名称或图片链接,可选值见 Icon 组件(如果设置了use-right-icon-slot,则该属性无效) | *string* | - | - | ### Events @@ -90,6 +94,8 @@ |-----------|-----------| | action | 自定义搜索框右侧按钮,需要在`use-action-slot`为 true 时才会显示 | | label | 自定义搜索框左侧文本 | +| left-icon | 自定义输入框左侧图标,需要在`use-left-icon-slot`为 true 时才会显示 | +| right-icon | 自定义输入框右侧图标,需要在`use-right-icon-slot`为 true 时才会显示 | ### 外部样式类 diff --git a/packages/search/index.ts b/packages/search/index.ts index 3582e974..ba8ab074 100644 --- a/packages/search/index.ts +++ b/packages/search/index.ts @@ -15,6 +15,13 @@ VantComponent({ inputAlign: String, showAction: Boolean, useActionSlot: Boolean, + useLeftIconSlot: Boolean, + useRightIconSlot: Boolean, + leftIcon: { + type: String, + value: 'search' + }, + rightIcon: String, placeholder: String, placeholderStyle: String, actionText: { diff --git a/packages/search/index.wxml b/packages/search/index.wxml index cb3d9f7b..1d0e6f1f 100644 --- a/packages/search/index.wxml +++ b/packages/search/index.wxml @@ -10,7 +10,8 @@ + > + + +