Created
December 24, 2021 10:58
-
-
Save badasscodr/0983faa5799d57889b56b72d83ea7a58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<!-- Use the component in the right place of the template --> | |
<tiptap-vuetify | |
v-model='content' | |
:extensions='extensions' | |
:toolbar-attributes="{ color: 'invert' }" | |
output-format='json' | |
/> | |
<pre>{{ content }}</pre> | |
</div> | |
</template> | |
<script> | |
// import the component and the necessary extensions | |
import { | |
Blockquote, | |
Bold, | |
BulletList, | |
Code, | |
HardBreak, | |
Heading, | |
History, | |
HorizontalRule, | |
Image, | |
Italic, | |
Link, | |
ListItem, | |
OrderedList, | |
Paragraph, | |
Strike, | |
TiptapVuetify, | |
Underline | |
} from 'tiptap-vuetify' | |
export default { | |
// specify TiptapVuetify component in "components" | |
components: { TiptapVuetify }, | |
data() { | |
return { | |
// declare extensions you want to use | |
extensions: [ | |
History, | |
Blockquote, | |
Link, | |
Underline, | |
Strike, | |
Italic, | |
ListItem, | |
BulletList, | |
OrderedList, | |
[Heading, { | |
options: { | |
levels: [1, 2, 3] | |
} | |
}], | |
Bold, | |
Code, | |
HorizontalRule, | |
Paragraph, | |
HardBreak, | |
Image | |
], | |
// starting editor's content | |
content: ` | |
<h1>Yay Headlines!</h1> | |
<p>All these <strong>cool tags</strong> are working now.</p> | |
` | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment