I'm using tiptap within a messaging service and would like to clear the contents of the editor when a message is uploaded. However, I can't quite work out how I would go about doing this.
Once again, looking for a little bit of assistance with this, please. 👍
I released 0.11.0 – you can call clearContent() now.
<template>
<div>
<editor ref="editor">
<div slot="content" slot-scope="props">
<p>Some content</p>
</div>
</editor>
<button @click="clear">Clear Content</button>
</div>
</template>
<script>
import { Editor } from 'tiptap'
export default {
components: {
Editor,
},
methods: {
clear() {
this.$refs.editor.clearContent()
}
},
}
</script>
You're a star @philippkuehn. Many thanks!
Most helpful comment
I released 0.11.0 – you can call
clearContent()now.Example