下面是我的代码。
父.vue
<client-only>
<EditorTiptap v-model="content" />
</client-only>
Tiptap.vue
<div class="editor-panel">
<editor-content :editor="editor" />
</div>
和
computed: {
html () {
if (!this.editor) return ''
return this.editor.getHTML()
},
}
在这样的结构中,如何将子组件的内容输入值发送给父组件呢?
为了在父组件中实现预览功能,必须实时获取子组件的内容。
我找不到用 computed 的 html 做任何事情的方法。
请告诉我如何在父组件中实现子组件(tiptap.vue)的编辑器输入作为预览。