mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Search): add error-message prop (#8442)
This commit is contained in:
parent
522ce16159
commit
96ae24496e
@ -255,6 +255,7 @@ Use `input-align` prop to align the input value.
|
||||
| show-word-limit | Whether to show word limit, need to set the `maxlength` prop | _boolean_ | `false` |
|
||||
| error | Whether to mark the input content in red | _boolean_ | `false` |
|
||||
| error-message | Error message | _string_ | - |
|
||||
| error-message-align | Error message align, can be set to `center` `right` | _string_ | `left` |
|
||||
| formatter | Input value formatter | _(val: string) => string_ | - |
|
||||
| format-trigger | When to format value,can be set to `onBlur` | _string_ | `onChange` |
|
||||
| arrow-direction | Can be set to `left` `up` `down` | _string_ | `right` |
|
||||
@ -262,7 +263,6 @@ Use `input-align` prop to align the input value.
|
||||
| label-width | Label width | _number \| string_ | `6.2em` |
|
||||
| label-align | Label align, can be set to `center` `right` | _string_ | `left` |
|
||||
| input-align | Input align, can be set to `center` `right` | _string_ | `left` |
|
||||
| error-message-align | Error message 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` |
|
||||
| left-icon | Left side icon name | _string_ | - |
|
||||
| right-icon | Right side icon name | _string_ | - |
|
||||
|
@ -275,9 +275,10 @@ export default {
|
||||
| clickable | 是否开启点击反馈 | _boolean_ | `false` |
|
||||
| is-link | 是否展示右侧箭头并开启点击反馈 | _boolean_ | `false` |
|
||||
| autofocus | 是否自动聚焦,iOS 系统不支持该属性 | _boolean_ | `false` |
|
||||
| show-word-limit | 是否显示字数统计,需要设置`maxlength`属性 | _boolean_ | `false` |
|
||||
| show-word-limit | 是否显示字数统计,需要设置 `maxlength` 属性 | _boolean_ | `false` |
|
||||
| error | 是否将输入内容标红 | _boolean_ | `false` |
|
||||
| error-message | 底部错误提示文案,为空时不展示 | _string_ | - |
|
||||
| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | _string_ | `left` |
|
||||
| formatter | 输入内容格式化函数 | _(val: string) => string_ | - |
|
||||
| format-trigger | 格式化函数触发的时机,可选值为 `onBlur` | _string_ | `onChange` |
|
||||
| arrow-direction | 箭头方向,可选值为 `left` `up` `down` | _string_ | `right` |
|
||||
@ -285,7 +286,6 @@ export default {
|
||||
| label-width | 左侧文本宽度,默认单位为 `px` | _number \| string_ | `6.2em` |
|
||||
| label-align | 左侧文本对齐方式,可选值为 `center` `right` | _string_ | `left` |
|
||||
| input-align | 输入框对齐方式,可选值为 `center` `right` | _string_ | `left` |
|
||||
| error-message-align | 错误提示文案对齐方式,可选值为 `center` `right` | _string_ | `left` |
|
||||
| autosize | 是否自适应内容高度,只对 textarea 有效,<br>可传入对象,如 { maxHeight: 100, minHeight: 50 },<br>单位为`px` | _boolean \| object_ | `false` |
|
||||
| left-icon | 左侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - |
|
||||
| right-icon | 右侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - |
|
||||
|
@ -128,6 +128,7 @@ Use `action` slot to custom right button, `cancel` event will no longer be Emitt
|
||||
| disabled | Whether to disable field | _boolean_ | `false` |
|
||||
| readonly | Whether to be readonly | _boolean_ | `false` |
|
||||
| error | Whether to mark the input content in red | _boolean_ | `false` |
|
||||
| error-message `v3.0.12` | Error message | _string_ | - |
|
||||
| formatter `v3.0.12` | Input value formatter | _(val: string) => string_ | - |
|
||||
| format-trigger `v3.0.12` | When to format value,can be set to `onBlur` | _string_ | `onChange` |
|
||||
| input-align | Text align of field, can be set to `center` `right` | _string_ | `left` |
|
||||
|
@ -144,6 +144,7 @@ export default {
|
||||
| disabled | 是否禁用输入框 | _boolean_ | `false` |
|
||||
| readonly | 是否将输入框设为只读状态,只读状态下无法输入内容 | _boolean_ | `false` |
|
||||
| error | 是否将输入内容标红 | _boolean_ | `false` |
|
||||
| error-message | 底部错误提示文案,为空时不展示 | _string_ | - |
|
||||
| formatter `v3.0.12` | 输入内容格式化函数 | _(val: string) => string_ | - |
|
||||
| format-trigger `v3.0.12` | 格式化函数触发的时机,可选值为 `onBlur` | _string_ | `onChange` |
|
||||
| input-align | 输入框内容对齐方式,可选值为 `center` `right` | _string_ | `left` |
|
||||
|
@ -35,6 +35,7 @@ export default defineComponent({
|
||||
actionText: String,
|
||||
background: String,
|
||||
showAction: Boolean,
|
||||
errorMessage: String,
|
||||
clearTrigger: String as PropType<FieldClearTrigger>,
|
||||
formatTrigger: String as PropType<FieldFormatTrigger>,
|
||||
shape: {
|
||||
@ -51,7 +52,7 @@ export default defineComponent({
|
||||
},
|
||||
},
|
||||
|
||||
emits: ['update:modelValue', 'search', 'cancel'],
|
||||
emits: ['search', 'cancel', 'update:modelValue'],
|
||||
|
||||
setup(props, { emit, slots, attrs }) {
|
||||
const filedRef = ref<ComponentInstance>();
|
||||
@ -108,6 +109,7 @@ export default defineComponent({
|
||||
'clearable',
|
||||
'modelValue',
|
||||
'clearTrigger',
|
||||
'errorMessage',
|
||||
'formatTrigger',
|
||||
] as const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user