Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix $form type error #6941

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions packages/forms/src/form/Form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,27 +213,29 @@ export interface FormSlots {
* Default content slot.
* @param {Object} scope - default slot's params.
*/
default: (scope: {
/**
* Registers a form field for validation and tracking.
* @param field - The name of the form field to register.
* @param options - Configuration options for the field, such as validation rules.
* @returns - Returns an object or value representing the registered field.
*/
register: (field: string, options: any) => any;
/**
* Resets the entire form state, clearing values and validation statuses.
*/
reset: () => void;
/**
* Indicates whether the form is valid, returning `true` if all fields pass validation.
*/
valid: boolean;
/**
* Stores the state of each form field, with the field name as the key and its state as the value.
*/
states: Record<string, FormFieldState>;
}) => VNode[];
default: (
scope: {
/**
* Registers a form field for validation and tracking.
* @param field - The name of the form field to register.
* @param options - Configuration options for the field, such as validation rules.
* @returns - Returns an object or value representing the registered field.
*/
register: (field: string, options: any) => any;
/**
* Resets the entire form state, clearing values and validation statuses.
*/
reset: () => void;
/**
* Indicates whether the form is valid, returning `true` if all fields pass validation.
*/
valid: boolean;

/**
* Index signature for dynamically added form fields.
*/
} & Record<string, FormFieldState>
) => VNode[];
}

/**
Expand Down
Loading