add editorProps to options
This commit is contained in:
@@ -68,6 +68,7 @@ useBuiltInExtensions
|
|||||||
| **Property** | **Type** | **Default** | **Description** |
|
| **Property** | **Type** | **Default** | **Description** |
|
||||||
| --- | :---: | :---: | --- |
|
| --- | :---: | :---: | --- |
|
||||||
| `content` | `Object\|String` | `null` | The editor state object used by Prosemirror. You can also pass HTML to the `content` slot. When used both, the `content` slot will be ignored. |
|
| `content` | `Object\|String` | `null` | The editor state object used by Prosemirror. You can also pass HTML to the `content` slot. When used both, the `content` slot will be ignored. |
|
||||||
|
| `editorProps` | `Object` | `{}` | A list of [Prosemirror editorProps](https://prosemirror.net/docs/ref/#view.EditorProps). |
|
||||||
| `editable` | `Boolean` | `true` | When set to `false` the editor is read-only. |
|
| `editable` | `Boolean` | `true` | When set to `false` the editor is read-only. |
|
||||||
| `autoFocus` | `Boolean` | `false` | Focus the editor on init. |
|
| `autoFocus` | `Boolean` | `false` | Focus the editor on init. |
|
||||||
| `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. |
|
| `extensions` | `Array` | `[]` | A list of extensions used, by the editor. This can be `Nodes`, `Marks` or `Plugins`. |
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export default class Editor {
|
|||||||
|
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
this.defaultOptions = {
|
this.defaultOptions = {
|
||||||
|
editorProps: {},
|
||||||
editable: true,
|
editable: true,
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
extensions: [],
|
extensions: [],
|
||||||
@@ -167,6 +168,9 @@ export default class Editor {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
new Plugin({
|
||||||
|
props: this.options.editorProps,
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user