Add modules to Editor (#4452)

pull/4587/head
Vinccool96 2023-10-05 09:09:34 -04:00 committed by GitHub
parent 1598c11055
commit 4dd5b46a2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -28,6 +28,12 @@ const EditorProps = [
type: "any",
default: "null",
description: "Inline style of the container."
},
{
name: "modules",
type: "object",
default: "null",
description: "Modules configuration, see <a href=\"https://quilljs.com/docs/modules/\">here</a> for available options."
}
];

View File

@ -6,6 +6,7 @@ declare class Editor extends Vue {
readonly?: boolean;
formats?: any[];
editorStyle?: string;
modules?: any;
$emit(eventName: 'input', event: string): this;
$emit(eventName: 'text-change', e: { htmlValue: string, textValue: any, delta: any, source: string}): this;
$slot: {

View File

@ -56,7 +56,8 @@ export default {
placeholder: String,
readonly: Boolean,
formats: Array,
editorStyle: null
editorStyle: null,
modules: null
},
quill: null,
watch: {
@ -69,7 +70,8 @@ export default {
mounted() {
this.quill = new Quill(this.$refs.editorElement, {
modules: {
toolbar: this.$refs.toolbarElement
toolbar: this.$refs.toolbarElement,
...this.modules
},
readOnly: this.readonly,
theme: 'snow',