- What is a module in Vue Rich Text Editor?
- How to import and inject modules
- Available modules in Rich Text Editor
Contact Support
Module in Vue Rich Text Editor Component
30 Apr 20256 minutes to read
The Vue Rich Text Editor component follows a modular architecture, enabling users to include or exclude features as needed to ensure optimal performance and customization.
What is a module in Vue Rich Text Editor?
In the Vue Rich Text Editor, a module refers to a self-contained feature or functionality that can be selectively enabled or disabled. These modules are provided as part of the @syncfusion/ej2-vue-richtexteditor package and can be injected to extend the editor’s capabilities.
For example, modules such as Toolbar
, Link
, Image
, HtmlEditor
, and QuickToolbar
enable specific tools and behavior in the Rich Text Editor interface.
How to import and inject modules
To use a module in the Vue Rich Text Editor, you must:
-
Import the required module from the Syncfusion package.
-
Inject it using the provider section and use
richtexteditor
as a key.
The following example demonstrates how to import and inject modules.
<template>
<ejs-richtexteditor ref="defaultRTE" :height="350" :value="rteValue">
</ejs-richtexteditor>
</template>
<script setup>
import { provide } from "vue";
import { RichTextEditorComponent as EjsRichtexteditor, Toolbar, Link, Image, HtmlEditor, QuickToolbar } from '@syncfusion/ej2-vue-richtexteditor';
const rteValue = `<p>The Syncfusion Rich Text Editor, a WYSIWYG (what you see is what you get) editor, is a user interface that allows you to create, edit, and format rich text content. You can try out a demo of this editor here.</p><p><b>Key features:</b></p><ul><li><p>Provides <IFRAME> and <DIV> modes.</p></li><li><p>Bulleted and numbered lists.</p></li><li><p>Handles images, hyperlinks, videos, hyperlinks, uploads, etc.</p></li><li><p>Contains undo/redo manager. </p></li></ul><div style='display: inline-block; width: 60%; vertical-align: top; cursor: auto;'><img alt='Sky with sun' src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png' width='309' style='min-width: 10px; min-height: 10px; width: 309px; height: 174px;' class='e-rte-image e-imginline e-rte-drag-image' height='174' /></div>`,
provide('richtexteditor', [Toolbar, Link, Image, HtmlEditor, QuickToolbar]);
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-lists/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-vue-richtexteditor/styles/material.css";
</style>
<template>
<ejs-richtexteditor ref="defaultRTE" :height="350" :value="rteValue">
</ejs-richtexteditor>
</template>
<script>
import { RichTextEditorComponent, Toolbar, Link, Image, HtmlEditor, QuickToolbar } from '@syncfusion/ej2-vue-richtexteditor';
export default {
name: "App",
components: {
"ejs-richtexteditor": RichTextEditorComponent
},
data() {
return {
rteValue: `<p>The Syncfusion Rich Text Editor, a WYSIWYG (what you see is what you get) editor, is a user interface that allows you to create, edit, and format rich text content. You can try out a demo of this editor here.</p><p><b>Key features:</b></p><ul><li><p>Provides <IFRAME> and <DIV> modes.</p></li><li><p>Bulleted and numbered lists.</p></li><li><p>Handles images, hyperlinks, videos, hyperlinks, uploads, etc.</p></li><li><p>Contains undo/redo manager. </p></li></ul><div style='display: inline-block; width: 60%; vertical-align: top; cursor: auto;'><img alt='Sky with sun' src='https://cdn.syncfusion.com/ej2/richtexteditor-resources/RTE-Overview.png' width='309' style='min-width: 10px; min-height: 10px; width: 309px; height: 174px;' class='e-rte-image e-imginline e-rte-drag-image' height='174' /></div>`,
}
},
provide: {
richtexteditor: [Toolbar, Link, Image, HtmlEditor, QuickToolbar]
}
}
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-base/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-inputs/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-lists/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-popups/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-buttons/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-navigations/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css";
@import "../../node_modules/@syncfusion/ej2-vue-richtexteditor/styles/material.css";
</style>
Available modules in Rich Text Editor
Module | Description |
---|---|
Toolbar |
Inject this module to enable the toolbar to access text formatting and Rich Text Editor features like bold, italic, font settings, and alignment tools. |
Link |
Inject this module to insert, edit, and remove hyperlinks within the content. |
Image |
Inject this module to insert and manage images in the Rich Text Editor. |
Table |
Inject this module for inserting and editing HTML tables in the Rich Text Editor. |
Count |
Inject this module to enable live character counting capabilities in the Rich Text Editor. |
HtmlEditor |
Inject this module to support the HTML source editing view, allowing users to switch between preview and source code modes. |
MarkdownEditor |
Inject this module to enable editing support, allowing users to write and preview content using standard Markdown syntax |
QuickToolbar |
Inject this module to displays a floating toolbar near selected content like images or links for quick actions. |
Resize |
Injecting this module enables users to resize the height and width of the editor area interactively using a resizable handle in the Rich Text Editor. |
FileManager |
Injecting this module provides users with a dialog interface to browse, upload, and insert files (especially images) from a server or cloud storage provider directly into the Rich Text Editor. |
PasteCleanup |
Inject this module to keep or clean up the formatting of pasted content in Rich Text Editor. |
FormatPainter |
Injecting this module allows users to copy formatting (like bold, italic, font size, color, etc.) from one section of text and apply it to another in the Rich Text Editor. |
EmojiPicker |
Injecting this module allows users to search, and insert emojis into the Rich Text Editor. |
These modules should be injected into the provide
section and use richtexteditor
as a key of the object.