add content to the typography extension page

This commit is contained in:
Hans Pagel
2020-11-05 22:47:44 +01:00
parent e90934aa96
commit dd3f84c4e3
4 changed files with 109 additions and 3 deletions

View File

@@ -0,0 +1,44 @@
<template>
<div>
<editor-content :editor="editor" />
</div>
</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'
import Typography from '@tiptap/extension-typography'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document(),
Paragraph(),
Text(),
Typography(),
],
content: `
<p>“I have been suffering from Typomania all my life, a sickness that is incurable but not lethal.”</p>
<p>— Erik Spiekermann, December 2008</p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>