在 Vue3 中使用自定义构建的 Ckeditor5 和 Vite

问题描述 投票:0回答:1

我正在使用 Quasar 和 Vite 以及 Vue3。 我想在我的项目中添加一个 ckeditor,但我需要有 base64 上传适配器 来上传图像。

我知道我必须使用在线构建器,选择我想要的功能,下载并使用它。

我做了这些事情,将 ckeditor5 文件夹放在我的 src/ 文件夹旁边。 我做了

npm install ckeditor5/
将该项目添加到我的项目中。

我还将 ckedtor 添加到引导文件中:

import { boot } from "quasar/wrappers";
import CKEditor from '@ckeditor/ckeditor5-vue';

export default boot(({ app }) => {
  app.use(CKEditor);
});

我最终尝试将它使用到像这样的 Vue 组件中:

<template>
    <ckeditor
        v-model="editorData"
        :editor="Editor"
        :config="editorConfig"
    />
</template>

<script setup>
import { ref } from "vue";
import Editor from "ckeditor5-custom-build";
import ckeditor from "src/boot/ckeditor";

const editorData = ref("");
const editorConfig = ref({});

</script>

注意:自定义ckeditor的包名称是“ckeditor5-custom-build”。 我遵循了 ckeditor 文档中的所有内容。

但是当页面加载时,我收到该错误: 语法错误:不明确的间接导出:默认

我真的不明白出了什么问题,我找不到任何相关文档。我尝试使用经典编辑器并添加插件,但出现错误:“重复模块”,这就是我变成在线构建器的原因

有什么想法吗?

javascript vuejs3 ckeditor vite quasar-framework
1个回答
0
投票

从“ckeditor5-custom-build”导入 * 作为 CustomCkEditor;

看看你是否可以用它来构建。

© www.soinside.com 2019 - 2024. All rights reserved.