feat: adds docs example
This commit is contained in:
@@ -46,6 +46,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
|
||||
| Option | Description |
|
||||
| ---------------------- | ------------------------------- |
|
||||
| **`initCollapsed`** | Set the initial collapsed state |
|
||||
| **`components.RowLabel`** | React component to be rendered as the label on the array row. [More](/admin/components/#field-component) |
|
||||
|
||||
|
||||
### Example
|
||||
@@ -68,6 +69,10 @@ const ExampleCollection: CollectionConfig = {
|
||||
plural: 'Slides',
|
||||
},
|
||||
fields: [ // required
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
}
|
||||
{
|
||||
name: 'image',
|
||||
type: 'upload',
|
||||
@@ -78,7 +83,14 @@ const ExampleCollection: CollectionConfig = {
|
||||
name: 'caption',
|
||||
type: 'text',
|
||||
}
|
||||
]
|
||||
],
|
||||
admin: {
|
||||
components: {
|
||||
RowLabel: ({ data, fallback }) => {
|
||||
return data?.title || fallback;
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user