Editor instance
Working with the underlying Tiptap editor — commands, content and events.
<EchoEditor> exposes the Tiptap Editor. Grab it from the create event or a template ref (see Configuration for all props and events).
Content
Commands
Commands can be chained; focus() returns focus to the editor after a toolbar click:
Commands contributed by Echo Editor extensions:
| Command | Extension |
|---|---|
setFullscreen() | Fullscreen |
togglePreview() | Preview |
toggleSourceCode() | SourceCode |
toggleSpecialCharacter(), insertSpecialCharacter(char) | SpecialCharacter |
setSearchTerm(), setReplaceTerm(), nextSearchResult(), replace(), replaceAll() … | FindAndReplace |
exportDocument(format, filename?) | Export |
setImage(attrs), updateImage(attrs) | Image |
setVideo(attrs), updateVideo(attrs) | Video |
setCodeBlock(attrs?) | CodeBlock |
setTableCellBackground(color), unsetTableCellBackground() | Table |
setColumns(), setThreeColumns(), setFourColumns(), setLayout(layout) | Columns |
setIframe(attrs) | Iframe |
indent(), outdent() | Indent |
setLineHeight(value) | LineHeight |
setFontSize(size), unsetFontSize() | FontSize |
Plus every command from the underlying Tiptap extensions (toggleHeading, insertTable, setLink, setTextAlign, …).
Events
Always remove listeners you add (editor.off(...)) when your component unmounts.
Reading state in Vue
editor.state is reactive, but reading it in a computed re-evaluates on every transaction. Prefer useEditorState.