Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update
Browse files Browse the repository at this point in the history
anncwb committed Sep 23, 2024
1 parent 75a113f commit 9c5e4b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/@core/ui-kit/form-ui/src/form-api.ts
Original file line number Diff line number Diff line change
@@ -43,11 +43,11 @@ function getDefaultState(): VbenFormProps {
}

export class FormApi {
private prevState: null | VbenFormProps = null;
// private api: Pick<VbenFormProps, 'handleReset' | 'handleSubmit'>;
public form = {} as FormActions;
isMounted = false;

public prevState: null | VbenFormProps = null;
isMounted = false;
public state: null | VbenFormProps = null;

stateHandler: StateHandler;
@@ -94,11 +94,11 @@ export class FormApi {
const prevSchema = this.prevState?.schema ?? [];
// 进行了删除schema操作
if (currentSchema.length < prevSchema.length) {
const schemaMap = new Map(
currentSchema.map((item) => [item.fieldName, item]),
const currentFields = new Set(
currentSchema.map((item) => item.fieldName),
);
const deletedSchema = prevSchema.filter(
(item) => !schemaMap.has(item.fieldName),
(item) => !currentFields.has(item.fieldName),
);

for (const schema of deletedSchema) {

0 comments on commit 9c5e4b4

Please sign in to comment.