types(Search): missing some props in jsx (#8485)

This commit is contained in:
neverland
2021-04-09 10:48:47 +08:00
committed by GitHub
parent 1217088d95
commit e1df4bd9c3
2 changed files with 50 additions and 68 deletions
+42 -37
View File
@@ -54,65 +54,70 @@ import type {
const [name, bem] = createNamespace('field');
// provide to Search component to inherit
export const fieldProps = {
formatter: Function as PropType<(value: string) => string>,
leftIcon: String,
rightIcon: String,
clearable: Boolean,
maxlength: [Number, String],
inputAlign: String as PropType<FieldTextAlign>,
placeholder: String,
errorMessage: String,
error: {
type: Boolean,
default: null,
},
disabled: {
type: Boolean,
default: null,
},
readonly: {
type: Boolean,
default: null,
},
clearIcon: {
type: String,
default: 'clear',
},
modelValue: {
type: [String, Number],
default: '',
},
clearTrigger: {
type: String as PropType<FieldClearTrigger>,
default: 'focus',
},
formatTrigger: {
type: String as PropType<FieldFormatTrigger>,
default: 'onChange',
},
};
export default defineComponent({
name,
props: {
...cellProps,
...fieldProps,
rows: [Number, String],
name: String,
rules: Array as PropType<FieldRule[]>,
autosize: [Boolean, Object] as PropType<boolean | FieldAutosizeConfig>,
leftIcon: String,
rightIcon: String,
clearable: Boolean,
formatter: Function as PropType<(value: string) => string>,
maxlength: [Number, String],
labelWidth: [Number, String],
labelClass: UnknownProp,
labelAlign: String as PropType<FieldTextAlign>,
inputAlign: String as PropType<FieldTextAlign>,
placeholder: String,
autocomplete: String,
errorMessage: String,
errorMessageAlign: String as PropType<FieldTextAlign>,
showWordLimit: Boolean,
errorMessageAlign: String as PropType<FieldTextAlign>,
type: {
type: String as PropType<FieldType>,
default: 'text',
},
error: {
type: Boolean,
default: null,
},
colon: {
type: Boolean,
default: null,
},
disabled: {
type: Boolean,
default: null,
},
readonly: {
type: Boolean,
default: null,
},
clearIcon: {
type: String,
default: 'clear',
},
modelValue: {
type: [String, Number],
default: '',
},
clearTrigger: {
type: String as PropType<FieldClearTrigger>,
default: 'focus',
},
formatTrigger: {
type: String as PropType<FieldFormatTrigger>,
default: 'onChange',
},
},
emits: [