move examples to own directory, add demo component to all example pages

This commit is contained in:
Hans Pagel
2020-08-20 17:31:27 +02:00
parent f13212b362
commit 854a0382b6
30 changed files with 57 additions and 21 deletions

View File

@@ -0,0 +1,32 @@
<template>
<editor-content :editor="editor" />
</template>
<script>
import { Editor, EditorContent, defaultExtensions } from '@tiptap/vue-starter-kit'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
content: '<p>foo</p>',
extensions: defaultExtensions(),
})
window.editor = this.editor
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>