docs: add more content about dispatching commands

This commit is contained in:
Hans Pagel
2021-01-13 11:08:37 +01:00
parent ecd0a6669a
commit 775adc7af7
2 changed files with 48 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
## Introduction
Node views are the best thing since sliced bread, at least if youre a fan of customization (and bread). Node views enable you to add literally anything to a node. If you can write it in JavaScript, you can use it in your editor.
```js
<!-- ```js
import { Node } from '@tiptap/core'
import { VueRenderer } from '@tiptap/vue'
import Component from './Component.vue'
@@ -23,7 +23,7 @@ export default Node.create({
})
},
})
```
``` -->
## Different types of node views
@@ -37,6 +37,10 @@ export default Node.create({
</div>
```
#### Example: Task item
https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-task-item/src/task-item.ts#L74
### Without content
```html
@@ -132,3 +136,13 @@ export default {
}
</script>
```
### Component with Content
```html
<template>
<node-view-wrapper class="dom">
<node-view-content class="content-dom" />
</node-view-wrapper>
</template>
```