Skip to content

Commit 3485092

Browse files
authoredAug 2, 2024··
fix(useFormGroup): app config default input size (#2011)

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed
 

‎src/runtime/composables/useFormGroup.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { inject, ref, computed } from 'vue'
22
import { type UseEventBusReturn, useDebounceFn } from '@vueuse/core'
33
import type { FormEvent, FormEventType, InjectedFormGroupValue } from '../types/form'
4-
import { mergeConfig } from '../utils'
5-
// @ts-expect-error
6-
import appConfig from '#build/app.config'
7-
import { formGroup } from '#ui/ui.config'
84

95
type InputProps = {
106
id?: string
@@ -16,8 +12,6 @@ type InputProps = {
1612
}
1713

1814

19-
const formGroupConfig = mergeConfig<typeof formGroup>(appConfig.ui.strategy, appConfig.ui.formGroup, formGroup)
20-
2115
export const useFormGroup = (inputProps?: InputProps, config?: any) => {
2216
const formBus = inject<UseEventBusReturn<FormEvent, string> | undefined>('form-events', undefined)
2317
const formGroup = inject<InjectedFormGroupValue | undefined>('form-group', undefined)
@@ -62,7 +56,7 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => {
6256
name: computed(() => inputProps?.name ?? formGroup?.name.value),
6357
size: computed(() => {
6458
const formGroupSize = config.size[formGroup?.size.value as string] ? formGroup?.size.value : null
65-
return inputProps?.size ?? formGroupSize ?? formGroupConfig?.default?.size
59+
return inputProps?.size ?? formGroupSize ?? config.default?.size
6660
}),
6761
color: computed(() => formGroup?.error?.value ? 'red' : inputProps?.color),
6862
emitFormBlur,

0 commit comments

Comments
 (0)
Please sign in to comment.