Add modules to Editor (#4452)
parent
1598c11055
commit
4dd5b46a2f
|
@ -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."
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue