#vue.js #ckeditor #nuxt.js #ckeditor5
Вопрос:
Я использую метод локального компонента для использования ckeditor и добавляю плагин Base64UploadAdapter в конфигурационный файл. но у меня есть ошибка ckeditor-дублированные модули, как я могу добавить плагин Base64UploadAdapter в ckeditor в компоненте nuxt для повторного использования этого компонента.
//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
и используйте в этом коде.
<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...
Комментарии:
1. Вы пробовали использовать плагины с
inject
помощью ? nuxtjs.org/docs/2.x/directory-structure/…