You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/2.customization/1.config.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,26 +44,31 @@ You can do this by passing a `config` prop to the `<AutoForm>` component:
44
44
45
45
### `components`
46
46
47
-
When a field in a form is rendered, the module automatically generates key
48
-
```ts
49
-
zodType._def.format??zodType._def.type
50
-
```
51
-
52
-
This key is used to look up the component to render the field.
53
-
You can override the default components used for rendering fields by specifying a mapping in the `components` option.
54
-
55
47
::caution
56
48
If you use string to define the component it **must** be [globally registered](https://nuxt.com/docs/4.x/guide/directory-structure/app/components#dynamic-components) to work.
57
49
To do this, name your component with the `.global.vue` suffix, or place it in `components/global/` directory.
58
50
::
59
51
52
+
This is one of the most important configuration options.
53
+
It allows you to specify which Vue component should be used to render each field type in the form.
54
+
55
+
When a field in a form is rendered, the module automatically generates a key:
56
+
```ts
57
+
zodType._def.format??zodType._def.type
58
+
```
59
+
60
+
This key is used to look up the component to render the field from the `components` mapping.
61
+
By providing a custom mapping you can override or add support for additional field types.
For default implementation and inspiration consult the [source code](https://github.com/Norbiros/nuxt-auto-form/tree/master/src/utils/components_map.ts).
0 commit comments