add node view playground
This commit is contained in:
29
docs/src/demos/Examples/NodeView/Test.ts
Normal file
29
docs/src/demos/Examples/NodeView/Test.ts
Normal 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)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user