我正在尝试将 tiptap ( https://github.com/scrumpy/tiptap ) 添加到表单 textarea 字段。
我不能让它工作。我没有收到任何错误,但表单元素不显示。
这是组件:
<template>
...
<div class="field">
<label>Body</label>
<editor-content :editor="editor" />
</div>
...
<script>
...
import { Editor, EditorContent } from 'tiptap'
...
components: {
Notification,
EditorContent
},
data () {
return {
...
editor: null
}
},
mounted() {
this.editor = new Editor({
content: '<textarea name="piece_body" v-model="piece_body" rows="20" placeholder="Start composing here..."></textarea>'
})
},
beforeDestroy() {
this.editor.destroy()
},
</script
>