diff --git a/src/field/README.md b/src/field/README.md index 1f0727555..b351d3065 100644 --- a/src/field/README.md +++ b/src/field/README.md @@ -247,6 +247,7 @@ Use `input-align` prop to align the input value. | required | Whether to show required mark | _boolean_ | `false` | | center | Whether to center content vertically | _boolean_ | `true` | | clearable | Whether to be clearable | _boolean_ | `false` | +| 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` | | clickable | Whether to show click feedback when clicked | _boolean_ | `false` | | is-link | Whether to show link icon | _boolean_ | `false` | @@ -265,7 +266,6 @@ Use `input-align` prop to align the input value. | autosize | Textarea auto resize,can accpet an object,
e.g. { maxHeight: 100, minHeight: 50 } | _boolean \| object_ | `false` | | left-icon | Left side icon name | _string_ | - | | right-icon | Right side icon name | _string_ | - | -| clear-icon `v3.0.12` | Clear icon name | _string_ | `clear` | | icon-prefix | Icon className prefix | _string_ | `van-icon` | | rules | Form validation rules | _Rule[]_ | - | | autocomplete `v3.0.3` | [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute of native input element | _string_ | - | diff --git a/src/field/README.zh-CN.md b/src/field/README.zh-CN.md index 2b9cf62df..738f2eae8 100644 --- a/src/field/README.zh-CN.md +++ b/src/field/README.zh-CN.md @@ -270,6 +270,7 @@ export default { | required | 是否显示表单必填星号 | _boolean_ | `false` | | center | 是否使内容垂直居中 | _boolean_ | `false` | | clearable | 是否启用清除图标,点击清除图标后会清空输入框 | _boolean_ | `false` | +| clear-icon `v3.0.12` | 清除[图标名称](#/zh-CN/icon)或图片链接 | _string_ | `clear` | | clear-trigger | 显示清除图标的时机,`always` 表示输入框不为空时展示,
`focus` 表示输入框聚焦且不为空时展示 | _string_ | `focus` | | clickable | 是否开启点击反馈 | _boolean_ | `false` | | is-link | 是否展示右侧箭头并开启点击反馈 | _boolean_ | `false` | @@ -288,7 +289,6 @@ export default { | autosize | 是否自适应内容高度,只对 textarea 有效,
可传入对象,如 { maxHeight: 100, minHeight: 50 },
单位为`px` | _boolean \| object_ | `false` | | left-icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - | | right-icon | 右侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - | -| clear-icon `v3.0.12` | 清除[图标名称](#/zh-CN/icon)或图片链接 | _string_ | `clear` | | icon-prefix | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | _string_ | `van-icon` | | rules | 表单校验规则,详见 [Form 组件](#/zh-CN/form#rule-shu-ju-jie-gou) | _Rule[]_ | - | | autocomplete `v3.0.3` | input 标签原生的[自动完成属性](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) | _string_ | - | diff --git a/src/search/README.md b/src/search/README.md index 36b539382..218771b84 100644 --- a/src/search/README.md +++ b/src/search/README.md @@ -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` | diff --git a/src/search/README.zh-CN.md b/src/search/README.zh-CN.md index fa09c85c1..299c6f6ed 100644 --- a/src/search/README.zh-CN.md +++ b/src/search/README.zh-CN.md @@ -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` 表示输入框不为空时展示,
`focus` 表示输入框聚焦且不为空时展示 | _string_ | `focus` | | autofocus | 是否自动聚焦,iOS 系统不支持该属性 | _boolean_ | `false` | | show-action | 是否在搜索框右侧显示取消按钮 | _boolean_ | `false` | diff --git a/src/search/Search.tsx b/src/search/Search.tsx index 8bfeccdcc..6269937f2 100644 --- a/src/search/Search.tsx +++ b/src/search/Search.tsx @@ -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 }}