From e70b3a7158e6529e32955e7b3dd5a9636ee27ea9 Mon Sep 17 00:00:00 2001 From: David Royer Date: Thu, 22 Aug 2019 19:29:10 -0400 Subject: [PATCH 01/36] fix: Fixes emitted names. Closes #4635. --- src/components/VueEditor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VueEditor.vue b/src/components/VueEditor.vue index 66fe072..bbb7541 100755 --- a/src/components/VueEditor.vue +++ b/src/components/VueEditor.vue @@ -184,7 +184,7 @@ export default { operations.map(operation => { if (operation.insert && operation.insert.hasOwnProperty("image")) { const { image } = operation.insert; - this.$emit("imageRemoved", image); + this.$emit("image-removed", image); } }); }, From 4b5f20be43e46bd87783b9d69690e7673d4c7a6a Mon Sep 17 00:00:00 2001 From: David Royer Date: Thu, 22 Aug 2019 19:29:41 -0400 Subject: [PATCH 02/36] docs: updates to kebab-case for emitted names --- README.md | 2 +- docs/api.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 38e7e81..fa10286 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ You can see below that 3 parameters are passed. ```vue diff --git a/docs/api.md b/docs/api.md index 4644a70..b7cc102 100644 --- a/docs/api.md +++ b/docs/api.md @@ -31,7 +31,7 @@ | blur | quill | Emitted on `blur` event | | selection-change | range, oldRange, source | Emitted on Quill's `selection-change` event | | text-change | delta, oldDelta, source | Emitted on Quill's `text-change` event | -| imageAdded | file, Editor, cursorLocation | Emitted when `useCustomImageHandler` is true and photo is being added to the editor | -| imageRemoved | image | Emitted when `useCustomImageHandler` is true and photo has been deleted | +| image-added | file, Editor, cursorLocation | Emitted when `useCustomImageHandler` is true and photo is being added to the editor | +| image-removed | image | Emitted when `useCustomImageHandler` is true and photo has been deleted | From 405ef58e47c68e68cb97ec4e121cf7f7b678ccde Mon Sep 17 00:00:00 2001 From: David Royer Date: Thu, 22 Aug 2019 19:29:48 -0400 Subject: [PATCH 03/36] chore: dev updates --- src/App.vue | 38 +++++++++++++------------------------- src/helpers/axios.js | 4 ++-- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5fc365a..036ea92 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,20 +9,22 @@ @focus="onEditorFocus" @blur="onEditorBlur" @imageAdded="handleImageAdded" - @imageRemoved="handleImageRemoved" + @image-removed="handleImageRemoved" /> - diff --git a/src/index.js b/src/index.js index f813cd0..f94c4d6 100644 --- a/src/index.js +++ b/src/index.js @@ -1,35 +1,20 @@ -import Quill from "quill"; -import VueEditor from "@/components/VueEditor.vue"; +/* eslint-disable no-console */ +import VueEditor from "./VueEditor"; -const version = "__VERSION__"; +const Plugin = { + install(Vue, options = {}) { + Vue.component("VueEditor", VueEditor); -// Declare install function executed by Vue.use() -export function install(Vue) { - if (install.installed) return; - install.installed = true; + // Vue.prototype.$modal = { + // show(name) { + // location.hash = name + // }, - Vue.component("VueEditor", VueEditor); -} - -const VPlugin = { - install, - version, - Quill, - VueEditor + // hide(name) { + // location.hash = '#' + // } + // } + } }; -// Auto-install when vue is found (eg. in browser via + + diff --git a/src/components/VueEditor.vue b/src/components/VueEditor.vue index 339969a..5b66790 100755 --- a/src/components/VueEditor.vue +++ b/src/components/VueEditor.vue @@ -15,19 +15,19 @@