add content to the dropcursor page

This commit is contained in:
Hans Pagel
2020-11-05 21:39:08 +01:00
parent a74453f96c
commit 810f3d6b6d
5 changed files with 54 additions and 42 deletions

View File

@@ -0,0 +1,5 @@
context('/examples/dropcursor', () => {
before(() => {
cy.visit('/examples/dropcursor')
})
})

View File

@@ -0,0 +1,46 @@
<template>
<div>
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor, EditorContent } from '@tiptap/vue-starter-kit'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Dropcursor from '@tiptap/extension-dropcursor'
import Image from '@tiptap/extension-image'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document(),
Paragraph(),
Text(),
Image(),
Dropcursor(),
],
content: `
<p>Try to drag around the image. While you drag, the editor should show a decoration under your cursor. The so called dropcursor.</p>
<img src="https://source.unsplash.com/8xznAGy4HcY/800x400" />
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>