add node view playground

This commit is contained in:
Philipp Kühn
2020-11-18 22:50:07 +01:00
parent 8146dd0842
commit b8886fa408
8 changed files with 138 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
import { Node } from '@tiptap/core'
import { VueRenderer } from '@tiptap/vue'
import Component from './Component.vue'
export default Node.create({
name: 'test',
group: 'block',
draggable: true,
selectable: false,
parseHTML() {
return [
{
tag: 'div[data-type="test"]',
},
]
},
renderHTML() {
return ['div', { 'data-type': 'test' }]
},
addNodeView() {
return VueRenderer(Component)
},
})