mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
feat(Search): add clear-icon prop (#4463)
* feat(Search): add clear-icon prop * docs(Search): update doc
This commit is contained in:
parent
cc0df907e7
commit
b5ab3bee64
@ -49,6 +49,10 @@ VantComponent({
|
||||
type: String,
|
||||
value: '6.2em',
|
||||
},
|
||||
clearIcon: {
|
||||
type: String,
|
||||
value: 'clear',
|
||||
},
|
||||
},
|
||||
|
||||
data: {
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
<van-icon
|
||||
wx:if="{{ showClear }}"
|
||||
name="clear"
|
||||
name="{{ clearIcon }}"
|
||||
class="van-field__clear-root van-field__icon-root"
|
||||
catch:touchstart="onClear"
|
||||
/>
|
||||
|
@ -134,6 +134,7 @@ Page({
|
||||
| use-right-icon-slot | 是否使用输入框右侧图标 slot | _boolean_ | `false` | - |
|
||||
| left-icon | 输入框左侧图标名称或图片链接,可选值见 Icon 组件(如果设置了 use-left-icon-slot,则该属性无效) | _string_ | `search` | - |
|
||||
| right-icon | 输入框右侧图标名称或图片链接,可选值见 Icon 组件(如果设置了 use-right-icon-slot,则该属性无效) | _string_ | - | - |
|
||||
| clear-icon `v1.8.4` | 清除[图标名称](#/icon)或图片链接 | _string_ | `clear` |
|
||||
|
||||
### Events
|
||||
|
||||
|
@ -44,6 +44,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
clearIcon: {
|
||||
type: String,
|
||||
value: 'clear',
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -21,6 +21,7 @@
|
||||
disabled="{{ disabled }}"
|
||||
readonly="{{ readonly }}"
|
||||
clearable="{{ clearable }}"
|
||||
clear-icon="{{ clearIcon }}"
|
||||
maxlength="{{ maxlength }}"
|
||||
input-align="{{ inputAlign }}"
|
||||
input-class="input-class"
|
||||
|
Loading…
x
Reference in New Issue
Block a user