add example demos

This commit is contained in:
Philipp Kühn
2021-08-25 12:13:46 +02:00
parent 15c7e1955a
commit 4607a2dbd5
82 changed files with 4993 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { Node, mergeAttributes } from '@tiptap/core'
import { VueNodeViewRenderer } from '@tiptap/vue-3'
import Component from './Component.vue'
export default Node.create({
name: 'paper',
group: 'block',
atom: true,
addAttributes() {
return {
lines: {
default: [],
},
}
},
parseHTML() {
return [
{
tag: 'div[data-type="paper"]',
},
]
},
renderHTML({ HTMLAttributes }) {
return ['div', mergeAttributes(HTMLAttributes, { 'data-type': 'paper' })]
},
addNodeView() {
return VueNodeViewRenderer(Component)
},
})