Files
ui/docs/content/3.components/form.md
Benjamin Canac e70aee4d69 docs: update
2024-08-06 11:22:01 +02:00

1.9 KiB

description, links, navigation
description links navigation
A form element that provides validation and submission handling.
label icon to
GitHub i-simple-icons-github https://github.com/benjamincanac/ui3/tree/dev/src/runtime/components/Form.vue
badge
label
Todo

Usage

Examples

API

Props

:component-props

Slots

:component-slots

Emits

:component-emits

Expose

When accessing the component via a template ref, you can use the following:

Name Type
submit(){lang="ts-type"} Promise<void>{lang="ts-type"}

Triggers form submission.

validate(path?: string | string[], opts: { silent?: boolean }){lang="ts-type"} Promise<T>{lang="ts-type"}

Triggers form validation. Will raise any errors unless opts.silent is set to true.

clear(path?: string){lang="ts-type"} void

Clears form errors associated with a specific path. If no path is provided, clears all form errors.

getErrors(path?: string){lang="ts-type"} FormError[]{lang="ts-type"}

Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.

setErrors(errors: FormError[], path?: string){lang="ts-type"} void

Sets form errors for a given path. If no path is provided, overrides all errors.

errors{lang="ts-type"} Ref<FormError[]>{lang="ts-type"}

A reference to the array containing validation errors. Use this to access or manipulate the error information.

disabled{lang="ts-type"} Ref<boolean>{lang="ts-type"}