cleanup drag handle example

This commit is contained in:
Philipp Kühn
2020-11-25 17:58:53 +01:00
parent b7ca33aeae
commit fd94e321ea
9 changed files with 80 additions and 118 deletions

View File

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