mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 19:59:02 +08:00
add extensions prop
This commit is contained in:
parent
dbefbb98fa
commit
a2f83b78c1
@ -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(),
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
"vue": "2.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"prosemirror-view": "^1.16.1",
|
||||
"@tiptap/starter-kit": "1.x"
|
||||
"prosemirror-view": "^1.16.1"
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user