improve the examples

This commit is contained in:
Hans Pagel
2020-09-24 17:56:42 +02:00
parent b718061de9
commit 26d808e1ba
13 changed files with 49 additions and 59 deletions

View File

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

View File

@@ -0,0 +1,44 @@
<template>
<editor-content :editor="editor" />
</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'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
content: `
<p>
This is a radically reduced version of tiptap. It has only support for a document, paragraphs and text. Thats it. Its probably too much for real minimalists though.
</p>
<p>
The paragraph extension is not literally required, but you need at least one node. That node can be something different, for example to render a task list and only that task list.
</p>
`,
extensions: [
Document(),
Paragraph(),
Text(),
],
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>