Skip to content

Commit 4bc1341

Browse files
committed
docs: add validation section to custom components page
1 parent 45a8d7c commit 4bc1341

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/docs/guide/customization/custom-components.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ const onFieldValueChanged = ({ target }) => {
8585
### Advanced example
8686
For a more advanced example, you can take a look at the [`FieldSelect`](/guide/fields/FieldSelect) ([source](https://github.com/kevinkosterr/vue3-form-generator/blob/69cb6aeb8e8c82926ec3598e7d73be2d1146a3f2/src/fields/core/FieldSelect.vue)) component.
8787

88+
## Compatibility with validation
89+
::: info
90+
If you want your component to be compatible with validation, you'll need to expose the `errors` value that is returned
91+
by [`useFieldValidate`](/guide/composables/useFieldValidate)
92+
:::
93+
8894
## Registering your component
8995
To use your component inside the form generator, your component must be globally available throughout your app. You do this
9096
by simply registering it in your `main.js` file. Names <strong>must</strong> start with `Field`.

0 commit comments

Comments
 (0)