Overview
TheEditorContent component is responsible for rendering the editable area of your Tiptap editor. It connects the editor instance created by useEditor to the DOM and handles the integration with Vue’s component system.
Signature
Props
Editor | null
default:"null"
required
The editor instance to render. This should be the ref returned from
useEditor.The component will automatically set up the editor’s DOM element and integrate it with Vue’s reactivity system.Behavior
Mount Phase
When the component mounts or the editor prop changes:- Appends the editor’s ProseMirror view DOM to the component’s root element
- Sets up the editor’s app context to enable Vue features like provide/inject
- Creates node views for custom Vue-based nodes
Unmount Phase
When the component unmounts:- Cleans up the editor’s content component reference
- Removes the app context reference
Rendering
The component renders as a<div> element that contains the ProseMirror editor view. All editor content and interactions happen within this container.
Examples
Basic Usage
With Styling
With Conditional Rendering
Multiple Editors
With Toolbar
Notes
- The component renders a plain
<div>that wraps the ProseMirror editor view - You can style the editor content using CSS with the
:deep()selector to target.ProseMirror - The editor prop can be reactive - changing it will update the rendered editor
- The component automatically handles cleanup when unmounted
- You can use multiple
EditorContentcomponents with different editor instances
See Also
- useEditor - Composable for creating editor instances
- BubbleMenu - Contextual menu component
- FloatingMenu - Floating menu component