```
-#### Example: Drag handles
-
-
-## Render Vue components
-
-### Node
+## Node views with JavaScript
+TODO
```js
import { Node } from '@tiptap/core'
@@ -87,13 +51,119 @@ import { VueNodeViewRenderer } from '@tiptap/vue-2'
import Component from './Component.vue'
export default Node.create({
+ addNodeView() {
+ return ({ editor, node, getPos, HTMLAttributes, decorations, extension }) => {
+ const dom = document.createElement('div')
+
+ dom.innerHTML = 'Hello, I’m a node view!'
+
+ return {
+ dom,
+ }
+ })
+ },
+})
+```
+
+## Node views with Vue
+Using Vanilla JavaScript can feel complex, if you are used to work in Vue. Good news: You can even use regular Vue components in your node views. There is just a little bit you need to know, but let’s go through this one by one.
+
+### Render a Vue component
+Here is what you need to do to render Vue components inside your text editor:
+
+1. [Create a node extension](/guide/build-extensions)
+2. Create a Vue component
+3. Pass that component to the provided `VueNodeViewRenderer`
+4. Register it with `addNodeView()`
+5. [Configure tiptap to use your new node](/guide/configuration)
+
+This is how your node could look like:
+
+```js
+import { Node } from '@tiptap/core'
+import { VueNodeViewRenderer } from '@tiptap/vue-2'
+import Component from './Component.vue'
+
+export default Node.create({
+ // configuration …
+
addNodeView() {
return VueNodeViewRenderer(Component)
},
})
```
-### Component
+There is a little bit of magic required to make this work. But don’t worry, we provide a Vue component you can use to get started easily. Don’t forget to add it to your custom Vue component, like shown below:
+
+```html
+
+
+ Vue Component
+
+
+```
+
+Got it? Let’s see that in action. Feel free to copy the example to get started.
+
+
+
+### Access node attributes
+
+```js
+props: {
+ node: {
+ type: Object,
+ required: true,
+ },
+},
+```
+
+```js
+this.node.attrs.count
+```
+
+### Update node attributes
+
+```js
+props: {
+ updateAttributes: {
+ type: Function,
+ required: true,
+ },
+},
+```
+
+```js
+this.updateAttributes({
+ count: this.node.attrs.count + 1,
+})
+```
+
+### Adding a content editable
+
+```html
+
+
+
+
+
+
+
```
-### Component with Content
+## Node views with React
+TODO
-```html
-
-
-
-
-
+## Rendered content
-