Files
directus/docs/reference/app/components/v-form.md
Nitwel c2e7c85bbd Update documentation of app (#4222)
* move component docs to documentation

* update app docs tables for components

* update docs

* Add components to docs sidebar

* fix generated tables

* fix tables

* rename transitions

* update tables

* update nested components

* update tables

* update tables

* update tables

* update v-table table

* add basic documentation to each component

* remove all stories of storybook

* add missing documentation

* undate tables

* update tables

* update docs sidebar

* update app docs

* remove unused references

* add general readme

* update docs

* make reference titiles smaller

* add reference tag

* improve docs

* update order of tabs in sidebar

* remove all readmes and stories from interfaces/displays

* Cleanup menu

* Remove storybook

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-02-24 17:48:19 -05:00

42 lines
2.4 KiB
Markdown

# Form
Renders a form using interfaces based on the passed collection name.
```html
<v-form
collection="articles"
:edits.sync="{}"
:initial-values="{
title: 'Hello World'
}"
/>
```
## Reference
#### Props
| Prop | Description | Default | Type |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------- |
| `collection` | The collection of which you want to render the fields | `undefined` | `String` |
| `fields` | Array of fields to render. This can be used instead of the collection prop | `undefined` | `Field[]` |
| `initial-values` | Object of the starting values of the fields | `null` | `FieldValues` |
| `edits` | The edits that were made after the form was rendered. Being used in `v-model` | `null` | `FieldValues` |
| `loading` | Display the form in a loading state. Prevents the ctx menus from being used and renders skeleton loaders for the fields | `false` | `Boolean` |
| `batch-mode` | If enabled, allows to select multiple entries | `false` | `Boolean` |
| `primary-key` | The primary key of the given collection | `null` | `[String, Number]` |
| `disabled` | Disables any interaction with the form | `false` | `Boolean` |
| `validation-errors` | Add custom validation to any field | `() => []` | `ValidationError[]` |
**Note**: You have to pass either the collection or fields prop.
#### Slots
n/a
#### Events
| Event | Description | Value |
| ------- | ------------------------ | ----- |
| `input` | Edits have been updated. | |