add basic text style mark

This commit is contained in:
Philipp Kühn
2020-11-06 14:46:59 +01:00
parent bdb90403eb
commit d6930a6ba6
5 changed files with 108 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<template>
<div v-if="editor">
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor } from '@tiptap/core'
import { EditorContent } from '@tiptap/vue'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Heading from '@tiptap/extension-heading'
import TextStyle from '@tiptap/extension-text-style'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document(),
Paragraph(),
Text(),
Heading(),
TextStyle(),
],
content: `
<h2>Hello</h2>
<p>This is text.</p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>