fix(FormGroup): ensure size exists in config (#695)

Co-authored-by: Sma11X <540351143@qq.com>
Co-authored-by: saveliy <savelii.moshkota@ext.jumingo.com>
This commit is contained in:
Levy
2023-10-28 08:59:51 -07:00
committed by GitHub
parent 5a2644b329
commit f5f33882f9

View File

@@ -54,7 +54,10 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => {
return {
inputId,
name: computed(() => inputProps?.name ?? formGroup?.name.value),
size: computed(() => inputProps?.size ?? formGroup?.size.value ?? config?.default?.size),
size: computed(() => {
const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null
return inputProps?.size ?? formGroupSize ?? config?.default?.size
}),
color: computed(() => formGroup?.error?.value ? 'red' : inputProps?.color),
emitFormBlur,
emitFormInput,