ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
27.36k stars 2.27k forks source link

editor.commands.setContent() is not a function #1291

Closed brettins closed 3 years ago

brettins commented 3 years ago

Description When I go to set the content of the text for the editor manually, I am unable to and get the error:

TypeError: this.editor.commands.setContent is not a function

Steps to reproduce the bug Create an editor. Try to set the content using editor.commands.setContent(contentHere) as per the docs here: https://www.tiptap.dev/api/commands/set-content

CodeSandbox I created a CodeSandbox to help you debug the issue: https://codesandbox.io/s/vue-issue-template-forked-0zf2v

Expected behavior That the content would be set and would show the new text content.

philippkuehn commented 3 years ago

Try to set the content using editor.commands.setContent(contentHere) as per the docs here: https://www.tiptap.dev/api/commands/set-content

These are the docs for v2. In v1 you have to use editor.setContent()

brettins commented 3 years ago

Thanks @philippkuehn, but I don't see a place to view the docs for tiptap v1, and v2 is in beta so I was going to avoid using it in a production environment. Is there a way to view the v1 docs or is V2 safe to use in a production environment?

philippkuehn commented 3 years ago

to be honest, v2 is way more stable than v1 :) website + docs for v1 are here: https://v1.tiptap.dev/

brettins commented 3 years ago

Ok thank you, I'll switch to V2 then! The "beta" threw me for a loop :)