Placeholder Text in Vue Rich Text Editor Component
18 Nov 20182 minutes to read
Specifies the placeholder for the Rich Text Editor’s content used when the editor’s content area is empty through the placeholder property.
You can customize the appearance of the placeholder text by targeting the e-rte-placeholder class in your CSS. This allows you to modify properties such as font family, color, and other styles.
.e-richtexteditor .e-rte-placeholder {
font-family: monospace;
}<template>
<div>
<ejs-richtexteditor ref="defaultRTE" :placeholder="placeholder"></ejs-richtexteditor>
</div>
</template>
<script setup>
import { provide } from "vue";
import { RichTextEditorComponent as EjsRichtexteditor, Toolbar, Link, Image, HtmlEditor, QuickToolbar } from '@syncfusion/ej2-vue-richtexteditor';
const placeholder = "Type Something";
provide('richtexteditor', [Toolbar, Link, Image, HtmlEditor, QuickToolbar]);
</script>
<style>
.e-richtexteditor .e-rte-placeholder {
font-family: monospace;
color: deeppink;
}
@import "../../node_modules/@syncfusion/ej2-base/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-lists/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-splitbuttons/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-vue-richtexteditor/styles/tailwind3.css";
</style><template>
<div>
<ejs-richtexteditor ref="defaultRTE" :placeholder="placeholder">
</ejs-richtexteditor>
</div>
<style>
.e-richtexteditor .e-rte-placeholder {
font-family: monospace;
color: deeppink;
}
</style>
</template>
<script>
import { RichTextEditorComponent, Toolbar, Link, Image, HtmlEditor, QuickToolbar } from '@syncfusion/ej2-vue-richtexteditor';
export default {
name: "App",
components: {
"ejs-richtexteditor": RichTextEditorComponent
},
data() {
return {
placeholder: "Type Something",
}
},
provide: {
richtexteditor: [Toolbar, Link, Image, HtmlEditor, QuickToolbar]
}
}
</script>
<style>
@import "../../node_modules/@syncfusion/ej2-base/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-inputs/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-lists/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-popups/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-buttons/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-navigations/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-splitbuttons/styles/tailwind3.css";
@import "../../node_modules/@syncfusion/ej2-vue-richtexteditor/styles/tailwind3.css";
</style>