mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] Field: add error-message-align prop (#3016)
This commit is contained in:
parent
cc997be877
commit
2d6269fba8
@ -129,6 +129,7 @@ Field support all native properties of input tag,such as `maxlength`、`placeh
|
|||||||
| error-message | Error message | `String` | `''` |
|
| error-message | Error message | `String` | `''` |
|
||||||
| label-align | Label text align, can be set to `center` `right` | `String` | `left` |
|
| label-align | Label text align, can be set to `center` `right` | `String` | `left` |
|
||||||
| input-align | Input text align, can be set to `center` `right` | `String` | `left` |
|
| input-align | Input text align, can be set to `center` `right` | `String` | `left` |
|
||||||
|
| error-message-align | Error message text align, can be set to `center` `right` | `String` | `left` |
|
||||||
| 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` | - |
|
||||||
|
@ -20,6 +20,7 @@ export default sfc({
|
|||||||
onIconClick: Function,
|
onIconClick: Function,
|
||||||
autosize: [Boolean, Object],
|
autosize: [Boolean, Object],
|
||||||
errorMessage: String,
|
errorMessage: String,
|
||||||
|
errorMessageAlign: String,
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'text'
|
default: 'text'
|
||||||
@ -243,7 +244,7 @@ export default sfc({
|
|||||||
{this.renderRightIcon()}
|
{this.renderRightIcon()}
|
||||||
{slots('button') && <div class={bem('button')}>{slots('button')}</div>}
|
{slots('button') && <div class={bem('button')}>{slots('button')}</div>}
|
||||||
</div>
|
</div>
|
||||||
{this.errorMessage && <div class={bem('error-message')}>{this.errorMessage}</div>}
|
{this.errorMessage && <div class={bem('error-message', this.errorMessageAlign)}>{this.errorMessage}</div>}
|
||||||
</Cell>
|
</Cell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,13 @@
|
|||||||
color: @red;
|
color: @red;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
&--center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--disabled {
|
&--disabled {
|
||||||
|
@ -131,6 +131,7 @@ Field 默认支持 Input 标签所有的原生属性,比如 `maxlength`、`pla
|
|||||||
| error-message | 底部错误提示文案,为空时不展示 | `String` | `''` | - |
|
| error-message | 底部错误提示文案,为空时不展示 | `String` | `''` | - |
|
||||||
| label-align | 文本对齐方式,可选值为 `center` `right` | `String` | `left` | 1.1.10 |
|
| label-align | 文本对齐方式,可选值为 `center` `right` | `String` | `left` | 1.1.10 |
|
||||||
| input-align | 输入框内容对齐方式,可选值为 `center` `right` | `String` | `left` | 1.1.10 |
|
| input-align | 输入框内容对齐方式,可选值为 `center` `right` | `String` | `left` | 1.1.10 |
|
||||||
|
| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | `String` | `left` | - |
|
||||||
| autosize | 自适应内容高度,只对 textarea 有效,可传入对象,<br>如 { maxHeight: 100, minHeight: 50 },单位为 px | `Boolean | Object` | `false` | 1.0.0 |
|
| autosize | 自适应内容高度,只对 textarea 有效,可传入对象,<br>如 { maxHeight: 100, minHeight: 50 },单位为 px | `Boolean | Object` | `false` | 1.0.0 |
|
||||||
| left-icon | 输入框左侧图标名称或图片链接,可选值见 Icon 组件 | `String` | - | 1.5.7 |
|
| left-icon | 输入框左侧图标名称或图片链接,可选值见 Icon 组件 | `String` | - | 1.5.7 |
|
||||||
| right-icon | 输入框尾部图标名称或图片链接,可选值见 Icon 组件 | `String` | - | 1.5.7 |
|
| right-icon | 输入框尾部图标名称或图片链接,可选值见 Icon 组件 | `String` | - | 1.5.7 |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user