Files
tiptap/docs/src/demos/Api/Schema/index.vue
2020-09-04 12:02:37 +02:00

42 lines
745 B
Vue

<template>
<pre>{{ this.html }}</pre>
</template>
<script>
import { generateHtml } from '@tiptap/core'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
export default {
data() {
return {
doc: {
'type': 'document',
'content': [{
'type': 'paragraph',
'attrs': {
'align': 'left'
},
'content': [{
'type': 'text',
'text': 'Example Text'
}]
}]
}
}
},
computed: {
html() {
return generateHtml(this.doc, [
new Document(),
new Paragraph(),
new Text(),
])
}
}
}
</script>