|
@@ -26,10 +26,17 @@ import {
|
|
|
OrderedList,
|
|
|
BulletList,
|
|
|
ListItem,
|
|
|
- CodeBlockHighlight
|
|
|
+ CodeBlockHighlight,
|
|
|
+ Placeholder
|
|
|
} from 'tiptap-extensions'
|
|
|
+
|
|
|
+import Title from '~/components/editor/components/Title'
|
|
|
+import Subtitle from '~/components/editor/components/Subtitle'
|
|
|
+import Doc from '~/components/editor/components/Doc'
|
|
|
+
|
|
|
import javascript from 'highlight.js/lib/languages/javascript'
|
|
|
import css from 'highlight.js/lib/languages/css'
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
EditorContent,
|
|
@@ -45,6 +52,21 @@ export default {
|
|
|
mounted(){
|
|
|
this.editor = new Editor({
|
|
|
extensions: [
|
|
|
+ new Doc(),
|
|
|
+ new Title(),
|
|
|
+ new Subtitle(),
|
|
|
+ new Placeholder({
|
|
|
+ showOnlyCurrent: false,
|
|
|
+ emptyNodeText: node => {
|
|
|
+ if (node.type.name === 'title') {
|
|
|
+ return 'Inspirational Title'
|
|
|
+ }
|
|
|
+ if (node.type.name === 'subtitle') {
|
|
|
+ return 'Some catchy subtitle'
|
|
|
+ }
|
|
|
+ return 'Write your story...'
|
|
|
+ }
|
|
|
+ }),
|
|
|
new Heading({ levels: [1, 2, 3]}),
|
|
|
new Bold(),
|
|
|
new Code(),
|