[英]Uncaught SyntaxError: The requested module '/ckeditor5/build/ckeditor.js' does not provide an export named 'default'
I'm building SPA website with VueJS for frontend and Laravel for backend.我正在构建 SPA 网站,前端使用 VueJS,后端使用 Laravel。 Now I want to add CKEditor custom build to Vue, I have do following steps in CKEditor Documentation, but I received this error:
现在我想将 CKEditor 自定义构建添加到 Vue,我在 CKEditor 文档中执行了以下步骤,但我收到此错误:
enter image description here在此处输入图像描述
Here is my code:这是我的代码:
enter image description here在此处输入图像描述
I'm using Vite instead of Webpack, Is it make problem?我用的是 Vite 而不是 Webpack,这有问题吗?
I want to use CKEditor custom build in my vue app我想在我的 vue 应用程序中使用 CKEditor 自定义构建
I have the same error but with ReactJS maybe it's work for you also.我有同样的错误,但 ReactJS 也许它也适合你。 Instead of make a classic import:
而不是进行经典导入:
import Editor from '../../path'
Just import directly like:像这样直接导入即可:
import from '../../path/'
After this, you can use ClassicEditor
in your <Ckeditor />
component.在此之后,您可以在
<Ckeditor />
组件中使用ClassicEditor
。 Here's the full example that works to me:这是对我有用的完整示例:
import { CKEditor } from '@ckeditor/ckeditor5-react';
import 'react-markdown-editor-lite/lib/index.css';
import '../../ckeditor5/build/ckeditor';
const RichText = ({ data }) => {
return (
<CKEditor
editor={ClassicEditor}
data={data}
onChange={(_, editor) => {
const data = editor.getData();
console.log(data);
}}
/>
);
};
export default RichText;
Hope it helps you:)希望对你有帮助:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.