add Base64UploadAdapter for ckeditor

Viewed 165

I use component locally method for use ckeditor and add Base64UploadAdapter plugin in config file. but i have error ckeditor-duplicated-modules how can i add truly Base64UploadAdapter plugin to ckeditor in nuxt component for Reuse this component.

//ckEditorNuxt

<template>
  <ckeditor
    :editor="editor"
    :value="value"
    :config="config"
    :tagName="tagName"
    :disabled="disabled"
    @input="event => $emit('input', event)"
  />
</template>

<script>

let Classiceditor
let CKEditor

if (process.client) {
  Classiceditor = require('@ckeditor/ckeditor5-build-classic')
  CKEditor = require('@ckeditor/ckeditor5-vue2')
} else {
  CKEditor = {component: {template: '<div></div>'}}
}


export default {
  name: "ckEditorNuxt",
  components: {
    ckeditor: CKEditor.component
  },

...and more

and use in this code.

<template>
  <v-card height="100%">
    <h4 class="pa-2">{{ title }}</h4>
    <client-only placeholder="loading...">
      <ckEditorNuxt v-model="contentHolder" :config="editorConfig"/>
    </client-only>
  </v-card>
</template>

<script>

import ckEditorNuxt from "@/components/ckEditor/ckEditorNuxt";
import {Base64UploadAdapter} from "@ckeditor/ckeditor5-upload";

export default {
  name: "PersianCKEditor",
  components: {
    ckEditorNuxt,
  },
  props: {
    title: String
  },
  data() {
    return {
      editorConfig: {
        plugins: [
          Base64UploadAdapter
        ],
        placeholder: this.title,
        removePlugins: ['Title'],
and more...
0 Answers
Related