We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b30270a commit 3b0b8d0Copy full SHA for 3b0b8d0
src/components/Form/src/hooks/useFormEvents.ts
@@ -210,7 +210,13 @@ export function useFormEvents({
210
first = false,
211
) {
212
const schemaList: FormSchema[] = cloneDeep(unref(getSchema));
213
-
+ const addSchemaIds: string[] = Array.isArray(schema)
214
+ ? schema.map((item) => item.field)
215
+ : [schema.field];
216
+ if (schemaList.find((item) => addSchemaIds.includes(item.field))) {
217
+ error('There are schemas that have already been added');
218
+ return;
219
+ }
220
const index = schemaList.findIndex((schema) => schema.field === prefixField);
221
const _schemaList = isObject(schema) ? [schema as FormSchema] : (schema as FormSchema[]);
222
if (!prefixField || index === -1 || first) {
0 commit comments