mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-25 09:20:36 +01:00
docs(content): lint fix
This commit is contained in:
@@ -15,6 +15,7 @@ It works with the [FormField](/components/form-field) component to display error
|
||||
### Schema Validation
|
||||
|
||||
It requires two props:
|
||||
|
||||
- `state` - a reactive object holding the form's state.
|
||||
- `schema` - a schema object from a validation library like [Zod](https://github.com/colinhacks/zod), [Yup](https://github.com/jquense/yup), [Joi](https://github.com/hapijs/joi), [Valibot](https://github.com/fabian-hiller/valibot) or [Superstruct](https://github.com/ianstormtaylor/superstruct).
|
||||
|
||||
@@ -73,6 +74,7 @@ Nested validation rules are handled using dot notation. For example, a rule like
|
||||
Use the `validate` prop to apply your own validation logic.
|
||||
|
||||
The validation function must return a list of errors with the following attributes:
|
||||
|
||||
- `message` - the error message to display.
|
||||
- `name` - the `name` of the `FormField` to send the error to.
|
||||
|
||||
@@ -91,6 +93,7 @@ props:
|
||||
### Input Events
|
||||
|
||||
The Form component automatically triggers validation when an input emits an `input`, `change`, or `blur` event.
|
||||
|
||||
- Validation on `input` occurs **as you type**.
|
||||
- Validation on `change` occurs when you **commit to a value**.
|
||||
- Validation on `blur` happens when an input **loses focus**.
|
||||
|
||||
Reference in New Issue
Block a user