Skip to content

Commit 4471520

Browse files
committed
fix: item error when not use in form, close #5343
1 parent 1e8bbcc commit 4471520

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/form/context.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const useProvideForm = (state: FormContextProps) => {
3737

3838
export const useInjectForm = () => {
3939
return inject(FormContextKey, {
40+
name: computed(() => undefined),
4041
labelAlign: computed(() => 'right' as FormLabelAlign),
4142
vertical: computed(() => false),
4243
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -45,10 +46,14 @@ export const useInjectForm = () => {
4546
removeField: (_eventKey: string) => {},
4647
model: computed(() => undefined),
4748
rules: computed(() => undefined),
49+
colon: computed(() => undefined),
50+
labelWrap: computed(() => undefined),
51+
labelCol: computed(() => undefined),
4852
requiredMark: computed(() => false),
53+
validateTrigger: computed(() => undefined),
4954
onValidate: () => {},
5055
validateMessages: computed(() => defaultValidateMessages),
51-
});
56+
} as FormContextProps);
5257
};
5358

5459
/** Used for ErrorList only */

0 commit comments

Comments
 (0)