mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-29 11:20:36 +01:00
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:
@@ -54,7 +54,10 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => {
|
|||||||
return {
|
return {
|
||||||
inputId,
|
inputId,
|
||||||
name: computed(() => inputProps?.name ?? formGroup?.name.value),
|
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),
|
color: computed(() => formGroup?.error?.value ? 'red' : inputProps?.color),
|
||||||
emitFormBlur,
|
emitFormBlur,
|
||||||
emitFormInput,
|
emitFormInput,
|
||||||
|
|||||||
Reference in New Issue
Block a user