[Vuejs]-How to update TipTap content dynamically with Vue 3?

1👍

How will the generatedText be generated? Through tiptap?

The v-model of tiptap is the editor.content value. You could give it an initial state but if you want to change the editor.content after some interaction with the wysiwyg (like onFocus) you could use: setContent

Or maybe this helps:
Listening for changes

0👍

I watched for the editor, then set the content:

import { watch } from 'vue'
import { useEditor } from '@tiptap/vue-3'

const editor = useEditor({
    content: ''
})

watch(editor, () => {
  editor?.value?.commands.setContent('<p>Hi Mars</p>')
})

Leave a comment