feat(Search): add clear-icon prop (#8439)

This commit is contained in:
neverland
2021-04-01 09:53:54 +08:00
committed by GitHub
parent 2a065f85ef
commit 10d2517581
5 changed files with 6 additions and 2 deletions
+1
View File
@@ -120,6 +120,7 @@ Use `action` slot to custom right button, `cancel` event will no longer be Emitt
| maxlength | Max length of value | _number \| string_ | - |
| placeholder | Placeholder | _string_ | - |
| clearable | Whether to be clearable | _boolean_ | `true` |
| clear-icon `v3.0.12` | Clear icon name | _string_ | `clear` |
| clear-trigger | When to display the clear icon, `always` means to display the icon when value is not empty, `focus` means to display the icon when input is focused | _string_ | `focus` |
| autofocus | Whether to auto focus, unsupported in iOS | _boolean_ | `false` |
| show-action | Whether to show right action button | _boolean_ | `false` |
+1
View File
@@ -136,6 +136,7 @@ export default {
| maxlength | 输入的最大字符数 | _number \| string_ | - |
| placeholder | 占位提示文字 | _string_ | - |
| clearable | 是否启用清除图标,点击清除图标后会清空输入框 | _boolean_ | `true` |
| clear-icon `v3.0.12` | 清除[图标名称](#/zh-CN/icon)或图片链接 | _string_ | `clear` |
| clear-trigger | 显示清除图标的时机,`always` 表示输入框不为空时展示,<br>`focus` 表示输入框聚焦且不为空时展示 | _string_ | `focus` |
| autofocus | 是否自动聚焦,iOS 系统不支持该属性 | _boolean_ | `false` |
| show-action | 是否在搜索框右侧显示取消按钮 | _boolean_ | `false` |
+2
View File
@@ -28,6 +28,7 @@ export default defineComponent({
props: {
label: String,
clearIcon: String,
rightIcon: String,
modelValue: String,
actionText: String,
@@ -121,6 +122,7 @@ export default defineComponent({
ref={filedRef}
type="search"
border={false}
clearIcon={props.clearIcon}
onKeypress={onKeypress}
{...fieldAttrs}
{...{ 'onUpdate:modelValue': onInput }}