add minimalist example

This commit is contained in:
Hans Pagel
2020-08-31 14:47:53 +02:00
parent c80e5eb38f
commit 69a56e5473
4 changed files with 50 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,40 @@
<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 for minimalisits. It has only support for a document, paragraphs and text, thats it.</p>',
extensions: [
new Document(),
new Paragraph(),
new Text(),
],
})
window.editor = this.editor
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>

View File

@@ -0,0 +1,3 @@
# Simple
<demo name="Examples/Simple" highlight="7-9,27-29" />

View File

@@ -30,6 +30,8 @@
items:
- title: Basic
link: /examples/basic
- title: Simple
link: /examples/simple
- title: Menu Bubble
link: /examples/menu-bubble
- title: Floating Menu