mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-25 10:56:35 +08:00
feat(Field): add icon-prefix prop (#5666)
This commit is contained in:
parent
05966e0469
commit
876b899fec
@ -242,6 +242,7 @@ Use `input-align` prop to align the input value
|
|||||||
| autosize | Textarea auto resize,can accpet an object,<br>e.g. { maxHeight: 100, minHeight: 50 } | *boolean \| object* | `false` |
|
| autosize | Textarea auto resize,can accpet an object,<br>e.g. { maxHeight: 100, minHeight: 50 } | *boolean \| object* | `false` |
|
||||||
| left-icon | Left side icon name | *string* | - |
|
| left-icon | Left side icon name | *string* | - |
|
||||||
| right-icon | Right side icon name | *string* | - |
|
| right-icon | Right side icon name | *string* | - |
|
||||||
|
| icon-prefix `v2.5.3` | Icon className prefix | *string* | `van-icon` |
|
||||||
| rules `v2.5.0` | Form validation rules | *Rule[]* | - |
|
| rules `v2.5.0` | Form validation rules | *Rule[]* | - |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
@ -261,6 +261,7 @@ export default {
|
|||||||
| autosize | 是否自适应内容高度,只对 textarea 有效,<br>可传入对象,如 { maxHeight: 100, minHeight: 50 },<br>单位为`px` | *boolean \| object* | `false` |
|
| autosize | 是否自适应内容高度,只对 textarea 有效,<br>可传入对象,如 { maxHeight: 100, minHeight: 50 },<br>单位为`px` | *boolean \| object* | `false` |
|
||||||
| left-icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | *string* | - |
|
| left-icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | *string* | - |
|
||||||
| right-icon | 右侧[图标名称](#/zh-CN/icon)或图片链接 | *string* | - |
|
| right-icon | 右侧[图标名称](#/zh-CN/icon)或图片链接 | *string* | - |
|
||||||
|
| icon-prefix `v2.5.3` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | *string* | `van-icon` |
|
||||||
| rules `v2.5.0` | 表单校验规则,详见 [Form 组件](#/zh-CN/form#rule-shu-ju-jie-gou) | *Rule[]* | - |
|
| rules `v2.5.0` | 表单校验规则,详见 [Form 组件](#/zh-CN/form#rule-shu-ju-jie-gou) | *Rule[]* | - |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
@ -437,7 +437,9 @@ export default createComponent({
|
|||||||
if (showLeftIcon) {
|
if (showLeftIcon) {
|
||||||
return (
|
return (
|
||||||
<div class={bem('left-icon')} onClick={this.onClickLeftIcon}>
|
<div class={bem('left-icon')} onClick={this.onClickLeftIcon}>
|
||||||
{this.slots('left-icon') || <Icon name={this.leftIcon} />}
|
{this.slots('left-icon') || (
|
||||||
|
<Icon name={this.leftIcon} classPrefix={this.iconPrefix} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -450,7 +452,9 @@ export default createComponent({
|
|||||||
if (showRightIcon) {
|
if (showRightIcon) {
|
||||||
return (
|
return (
|
||||||
<div class={bem('right-icon')} onClick={this.onClickRightIcon}>
|
<div class={bem('right-icon')} onClick={this.onClickRightIcon}>
|
||||||
{slots('right-icon') || <Icon name={this.rightIcon} />}
|
{slots('right-icon') || (
|
||||||
|
<Icon name={this.rightIcon} classPrefix={this.iconPrefix} />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user