improve the generateHtml example
This commit is contained in:
@@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { generateHtml } from '@tiptap/core'
|
import { generateHtml } from '@tiptap/core'
|
||||||
import { defaultExtensions } from '@tiptap/vue-starter-kit'
|
import Document from '@tiptap/extension-document'
|
||||||
|
import Paragraph from '@tiptap/extension-paragraph'
|
||||||
|
import Text from '@tiptap/extension-text'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
@@ -19,7 +21,7 @@ export default {
|
|||||||
},
|
},
|
||||||
'content': [{
|
'content': [{
|
||||||
'type': 'text',
|
'type': 'text',
|
||||||
'text': 'My sample text'
|
'text': 'Example Text'
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
@@ -28,9 +30,11 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
html() {
|
html() {
|
||||||
const extensions = defaultExtensions()
|
return generateHtml(this.doc, [
|
||||||
|
new Document(),
|
||||||
return generateHtml(this.doc, extensions)
|
new Paragraph(),
|
||||||
|
new Text(),
|
||||||
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user