Skip to content

Commit

Permalink
fix: 🐛 fix emit arguments
Browse files Browse the repository at this point in the history
wrap destructured arguments into object
  • Loading branch information
luthfimasruri committed Mar 18, 2021
1 parent 5fdcf79 commit 18266b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/QuillEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ export default defineComponent({
const handleTextChange: TextChangeHandler = (...args) => {
// Update v-model:content when text changes
ctx.emit("update:content", quill?.getContents());
ctx.emit("textChange", ...args);
ctx.emit("textChange", { ...args });
};

const isEditorFocus = ref<boolean>()
const handleSelectionChange: SelectionChangeHandler = (...args) => {
// Mark model as touched if editor lost focus
isEditorFocus.value = quill?.hasFocus() ? true : false
ctx.emit("selectionChange", ...args);
ctx.emit("selectionChange", { ...args });
};

watch(isEditorFocus, (focus) => {
Expand All @@ -157,7 +157,7 @@ export default defineComponent({
})

const handleEditorChange: EditorChangeHandler = (name: String, ...args) => {
ctx.emit("editorChange", name, ...args);
ctx.emit("editorChange", { name, ...args });
};

const getQuill = (): Quill => {
Expand Down

0 comments on commit 18266b0

Please sign in to comment.