Skip to content

Commit

Permalink
fix(FormGroup): ensure size exists in config (#695)
Browse files Browse the repository at this point in the history
Co-authored-by: Sma11X <540351143@qq.com>
Co-authored-by: saveliy <savelii.moshkota@ext.jumingo.com>
  • Loading branch information
3 people authored Oct 28, 2023
1 parent 5a2644b commit f5f3388
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime/composables/useFormGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

1 comment on commit f5f3388

@vercel
Copy link

@vercel vercel bot commented on f5f3388 Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ui – ./

ui-nuxt-js.vercel.app
ui.nuxt.com
ui-git-dev-nuxt-js.vercel.app

Please sign in to comment.