Added NodeView Prop Types documentation

This commit is contained in:
ryanbliss 2019-07-26 17:04:52 -06:00
parent b77a31a06e
commit 3e8eec6364

View File

@ -446,6 +446,19 @@ export default class IframeNode extends Node {
} }
``` ```
#### NodeView Prop Types
| **Prop** | **Type** | **Description** |
| --- | :---: | --- |
| `node` | `Object` | The Prosemirror node object. Common use case is to get `node.attrs` using a getter on a computed property. |
| `updateAttrs` | `Function` | A function to update `node.attrs` defined in `schema`. Common use case is as setter on a computed property. |
| `view` | `Object` | The Prosemirror editor view instance. |
| `options` | `Array` | An array of your extension options. |
| `getPos` | `Function` | A function that returns the anchored position of the node. |
| `selection` | `Boolean` | A boolean that is set when the node is or is not selected. Common use case is using `watch` to see when the view is selected/unselected to do something, such focus an `<input>` or refocus the editor. |
## Editor Methods
## Development Setup ## Development Setup
Currently, only Yarn is supported for development because of a feature called workspaces we are using here. Currently, only Yarn is supported for development because of a feature called workspaces we are using here.