add extensions prop

This commit is contained in:
Philipp Kühn 2020-11-12 10:14:50 +01:00
parent dbefbb98fa
commit a2f83b78c1
3 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,6 @@
<template>
<div>
<full-editor v-model="content" />
<full-editor v-model="content" :extensions="extensions" />
<div>
{{ content }}
</div>
@ -9,6 +9,7 @@
<script>
import { FullEditor } from '@tiptap/vue'
import { defaultExtensions } from '@tiptap/starter-kit'
export default {
components: {
@ -18,6 +19,7 @@ export default {
data() {
return {
content: '<p>full editor</p>',
extensions: defaultExtensions(),
}
},
}

View File

@ -15,7 +15,6 @@
"vue": "2.x"
},
"dependencies": {
"prosemirror-view": "^1.16.1",
"@tiptap/starter-kit": "1.x"
"prosemirror-view": "^1.16.1"
}
}

View File

@ -6,7 +6,6 @@
<script>
import { Editor } from '@tiptap/core'
import { defaultExtensions } from '@tiptap/starter-kit'
import EditorContent from './EditorContent.ts'
export default {
@ -19,6 +18,12 @@ export default {
type: [String, Object],
default: '',
},
extensions: {
type: Array,
required: true,
default: () => [],
},
},
data() {
@ -29,7 +34,7 @@ export default {
mounted() {
this.editor = new Editor({
extensions: defaultExtensions(),
extensions: this.extensions,
content: this.value,
})