fix: item error when not use in form, close #5343
parent
1e8bbccdd2
commit
4471520e35
|
@ -37,6 +37,7 @@ export const useProvideForm = (state: FormContextProps) => {
|
||||||
|
|
||||||
export const useInjectForm = () => {
|
export const useInjectForm = () => {
|
||||||
return inject(FormContextKey, {
|
return inject(FormContextKey, {
|
||||||
|
name: computed(() => undefined),
|
||||||
labelAlign: computed(() => 'right' as FormLabelAlign),
|
labelAlign: computed(() => 'right' as FormLabelAlign),
|
||||||
vertical: computed(() => false),
|
vertical: computed(() => false),
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
@ -45,10 +46,14 @@ export const useInjectForm = () => {
|
||||||
removeField: (_eventKey: string) => {},
|
removeField: (_eventKey: string) => {},
|
||||||
model: computed(() => undefined),
|
model: computed(() => undefined),
|
||||||
rules: computed(() => undefined),
|
rules: computed(() => undefined),
|
||||||
|
colon: computed(() => undefined),
|
||||||
|
labelWrap: computed(() => undefined),
|
||||||
|
labelCol: computed(() => undefined),
|
||||||
requiredMark: computed(() => false),
|
requiredMark: computed(() => false),
|
||||||
|
validateTrigger: computed(() => undefined),
|
||||||
onValidate: () => {},
|
onValidate: () => {},
|
||||||
validateMessages: computed(() => defaultValidateMessages),
|
validateMessages: computed(() => defaultValidateMessages),
|
||||||
});
|
} as FormContextProps);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Used for ErrorList only */
|
/** Used for ErrorList only */
|
||||||
|
|
Loading…
Reference in New Issue