docs(richtext-slate): update outdated code example (#5572) (#5573)

This commit is contained in:
Alessio Gravili
2024-03-31 17:50:15 -04:00
committed by GitHub
parent 51fbd02b40
commit 71a5a02e8c

View File

@@ -167,7 +167,9 @@ Specifying custom `Type`s let you extend your custom elements by adding addition
`collections/ExampleCollection.ts`
```ts
import { CollectionConfig } from 'payload/types'
import type { CollectionConfig } from 'payload/types'
import { slateEditor } from '@payloadcms/richtext-slate'
export const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
@@ -181,6 +183,7 @@ export const ExampleCollection: CollectionConfig = {
},
],
required: true,
editor: slateEditor({
admin: {
elements: [
'h2',
@@ -232,6 +235,7 @@ export const ExampleCollection: CollectionConfig = {
},
},
},
}),
},
],
}