docs: update content

This commit is contained in:
Hans Pagel
2020-11-17 15:38:46 +01:00
parent 7e2f7f7a0f
commit 4579a15300
4 changed files with 48 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
<template>
<pre><code>{{ html }}</code></pre>
<pre><code>{{ output }}</code></pre>
</template>
<script>
@@ -7,29 +7,44 @@ import { generateHTML } from '@tiptap/html'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Bold from '@tiptap/extension-bold'
export default {
data() {
return {
output: '',
json: {
type: 'document',
content: [{
type: 'paragraph',
content: [{
type: 'text',
text: 'Example Text',
}],
}],
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Example ',
},
{
type: 'text',
marks: [
{
type: 'bold',
},
],
text: 'Text',
},
],
},
],
},
html: '',
}
},
mounted() {
this.html = generateHTML(this.json, [
this.output = generateHTML(this.json, [
Document,
Paragraph,
Text,
Bold,
])
},
}