docs: update content

This commit is contained in:
Hans Pagel
2021-03-09 11:17:48 +01:00
parent d49af82a85
commit 6f38e15450
7 changed files with 231 additions and 12 deletions

View File

@@ -0,0 +1,65 @@
<template>
<editor-content :editor="editor" />
</template>
<script>
import { Editor, EditorContent } from '@tiptap/vue-2'
import { defaultExtensions } from '@tiptap/starter-kit'
import VueComponent from './index.js'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
...defaultExtensions(),
VueComponent,
],
content: `
<p>
This is still the text editor youre used to, but enriched with node views.
</p>
<vue-component>
<p>This is editable.</p>
</vue-component>
<p>
Did you see that? Thats a Vue component. We are really living in the future.
</p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>
<style lang="scss">
/* Basic editor styles */
.ProseMirror {
> * + * {
margin-top: 0.75em;
}
}
.output {
background-color: #0D0D0D;
color: #fff;
padding: 1rem;
font-family: monospace;
font-size: 1.1rem;
border-radius: 0.5rem;
margin: 1rem 0;
position: relative;
}
</style>