mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
feat(Search): add error-message prop (#8442)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user