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", type: "any",
default: "null", default: "null",
description: "Inline style of the container." 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; readonly?: boolean;
formats?: any[]; formats?: any[];
editorStyle?: string; editorStyle?: string;
modules?: any;
$emit(eventName: 'input', event: string): this; $emit(eventName: 'input', event: string): this;
$emit(eventName: 'text-change', e: { htmlValue: string, textValue: any, delta: any, source: string}): this; $emit(eventName: 'text-change', e: { htmlValue: string, textValue: any, delta: any, source: string}): this;
$slot: { $slot: {
@ -13,4 +14,4 @@ declare class Editor extends Vue {
} }
} }
export default Editor; export default Editor;

View File

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