vueup / vue-quill

Rich Text Editor Component for Vue 3.
https://vueup.github.io/vue-quill/
MIT License
1.13k stars 282 forks source link

quill Overwriting modules/ImageUploader with class... #384

Closed hsiangfeng closed 1 year ago

hsiangfeng commented 1 year ago

Version @vueup/vue-quill version 1.1.0

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. register modules/ImageUploader
  2. Click Button v-if toggle QuillEditor
  3. See Error 「quill Overwriting modules/ImageUploader with class ...」

Expected behavior

圖片

now show error.

Reproduction link Link:https://codesandbox.io/s/blissful-haze-7vlsm5

Browser (please complete the following information):

Additional context no.

hank2718 commented 1 year ago

I also have the same problem!

hsiangfeng commented 1 year ago

I also have the same problem!

Hey! I found a solution later! The solution is just to use the following method

if (!Quill. imports['modules/ImageUploader']) {
   Quill. register('modules/ImageUploader', ImageUploader);
}

I also wrote an article, you can refer to it~ https://israynotarray.com/javascript/20230629/1402048802/

Since this problem is solved, I'm closing this issue.