Skip to content

Commit

Permalink
fix: composeOptions object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
luthfimasruri committed Mar 18, 2021
1 parent 8c7d545 commit e161363
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/QuillEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ export default defineComponent({

// Compose Options
const composeOptions = (): QuillOptionsStatic => {
const clientOptions: QuillOptionsStatic = {
theme: props.theme === "" ? undefined : props.theme,
readOnly: props.readOnly,
placeholder: props.placeholder,
modules: {
const clientOptions: QuillOptionsStatic = {}
if (props.theme !== "")
clientOptions.theme = props.theme
if (props.readOnly)
clientOptions.readOnly = props.readOnly
if (props.placeholder)
clientOptions.placeholder = props.placeholder
if (props.theme && props.theme !== "") {
clientOptions.modules = {
toolbar: (() => {
if (typeof props.toolbar === "object") {
return props.toolbar
Expand All @@ -133,7 +137,7 @@ export default defineComponent({
}
})()
}
};
}
return Object.assign(
{},
props.globalOptions,
Expand Down

0 comments on commit e161363

Please sign in to comment.