在Angular上安装CKEditor(版本5)

发布于 2025-02-12 08:06:11 字数 1131 浏览 0 评论 0原文

我正在尝试使用ckeditor5-image安装ckeditor5,但我会遇到Angular 12的错误。我的软件包。JSON在依赖项下的json看起来如下所示

"@ckeditor/ckeditor5-angular": "^4.0.0",
"@ckeditor/ckeditor5-build-classic": "^34.1.0",
"@ckeditor/ckeditor5-image": "^34.2.0", 

,如下

ts file html

public Editor = ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [ AutoImage ],

    } )

editorData =
    `<p><a href="https://maps.google.co.uk">https://maps.google.co.uk</a></p>`;

html html文件,

<ckeditor #editor
    [data]="editorData"
    [editor]="Editor"
    id="classic-editor"
    name="classic-editor">
</ckeditor>

错误是node_modules中的所有svg文件

./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg:1:0 - Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

我想知道是否有人可以提供帮助?

I am trying to install ckEditor5 with ckeditor5-image but I get errors with angular 12. My package.json looks as below under dependencies

"@ckeditor/ckeditor5-angular": "^4.0.0",
"@ckeditor/ckeditor5-build-classic": "^34.1.0",
"@ckeditor/ckeditor5-image": "^34.2.0", 

My code is as below

ts file

public Editor = ClassicEditor
    .create( document.querySelector( '#editor' ), {
        plugins: [ AutoImage ],

    } )

editorData =
    `<p><a href="https://maps.google.co.uk">https://maps.google.co.uk</a></p>`;

html file

<ckeditor #editor
    [data]="editorData"
    [editor]="Editor"
    id="classic-editor"
    name="classic-editor">
</ckeditor>

The errors are about all svg files in node_modules

./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg:1:0 - Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

I wonder if anyone can help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文