diff --git a/examples/Components/Routes/DragHandle/DragItem.js b/examples/Components/Routes/DragHandle/DragItem.js new file mode 100644 index 000000000..66ed3c003 --- /dev/null +++ b/examples/Components/Routes/DragHandle/DragItem.js @@ -0,0 +1,32 @@ +import { Node } from 'tiptap' + +export default class DragItem extends Node { + + get name() { + return 'drag_item' + } + + get schema() { + return { + group: 'block', + draggable: true, + content: 'paragraph+', + toDOM: () => ['div', { 'data-type': this.name }, 0], + parseDOM: [{ + tag: `[data-type="${this.name}"]`, + }], + } + } + + get view() { + return { + template: ` +
+
+
+
+ `, + } + } + +} diff --git a/examples/Components/Routes/DragHandle/index.vue b/examples/Components/Routes/DragHandle/index.vue new file mode 100644 index 000000000..dbcaec96f --- /dev/null +++ b/examples/Components/Routes/DragHandle/index.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/examples/Components/Subnavigation/index.vue b/examples/Components/Subnavigation/index.vue index f1a05f929..a4a773455 100644 --- a/examples/Components/Subnavigation/index.vue +++ b/examples/Components/Subnavigation/index.vue @@ -60,6 +60,9 @@ Trailing Paragraph + + Drag Handle + Export HTML or JSON diff --git a/examples/main.js b/examples/main.js index 8ee8e3e74..e873023f6 100644 --- a/examples/main.js +++ b/examples/main.js @@ -151,6 +151,13 @@ const routes = [ githubUrl: 'https://github.com/scrumpy/tiptap/tree/master/examples/Components/Routes/TrailingParagraph', }, }, + { + path: '/drag-handle', + component: () => import('Components/Routes/DragHandle'), + meta: { + githubUrl: 'https://github.com/scrumpy/tiptap/tree/master/examples/Components/Routes/DragHandle', + }, + }, { path: '/export', component: () => import('Components/Routes/Export'),