add minimalist example
This commit is contained in:
5
docs/src/demos/Examples/Simple/index.spec.js
Normal file
5
docs/src/demos/Examples/Simple/index.spec.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
context('simple', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit('/examples/simple')
|
||||||
|
})
|
||||||
|
})
|
||||||
40
docs/src/demos/Examples/Simple/index.vue
Normal file
40
docs/src/demos/Examples/Simple/index.vue
Normal 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, that’s it.</p>',
|
||||||
|
extensions: [
|
||||||
|
new Document(),
|
||||||
|
new Paragraph(),
|
||||||
|
new Text(),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
window.editor = this.editor
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
this.editor.destroy()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
3
docs/src/docPages/examples/simple.md
Normal file
3
docs/src/docPages/examples/simple.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Simple
|
||||||
|
|
||||||
|
<demo name="Examples/Simple" highlight="7-9,27-29" />
|
||||||
@@ -30,6 +30,8 @@
|
|||||||
items:
|
items:
|
||||||
- title: Basic
|
- title: Basic
|
||||||
link: /examples/basic
|
link: /examples/basic
|
||||||
|
- title: Simple
|
||||||
|
link: /examples/simple
|
||||||
- title: Menu Bubble
|
- title: Menu Bubble
|
||||||
link: /examples/menu-bubble
|
link: /examples/menu-bubble
|
||||||
- title: Floating Menu
|
- title: Floating Menu
|
||||||
|
|||||||
Reference in New Issue
Block a user