我对前端技术非常(非常)陌生,特别是 React 和 TypeScript。
当尝试做一件简单的事情,即使用反应组件时,我的问题出现了https://github.com/ckeditor/ckeditor5 https://github.com/ckeditor/ckeditor5
所以我查看了示例并发现了这一点:
https://github.com/ckeditor/ckeditor5-react-example/blob/master/package.json https://github.com/ckeditor/ckeditor5-react-example/blob/master/package.json
我正在尝试包括ckeditor与经典编辑器 module
所以我将其添加到我的 package.json 中
"@ckeditor/ckeditor5-editor-classic": "^12.0.0",
"@ckeditor/ckeditor5-essentials": "^11.0.0",
"@ckeditor/ckeditor5-paragraph": "^11.0.0",
"@ckeditor/ckeditor5-react": "^1.1.2",
并在此处检查实施情况https://github.com/ckeditor/ckeditor5-react-example/blob/master/src/App.js https://github.com/ckeditor/ckeditor5-react-example/blob/master/src/App.js
我需要导入打字稿的模块定义(我猜)
import CKEditor from '@ckeditor/ckeditor5-react';
// NOTE: We use editor from source (not a build)!
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
所以,这部分有这个奇怪的注释,但碰巧在我的项目中不起作用(说丢失并且找不到它)
知道我还能做什么来添加它吗?我尝试删除/src/classiceditor
部分但仍然失踪。
我制造了一个npm install
我可以看到包含 package.json 的 classiceditor 代码等等.../src/经典编辑器文件夹实际上存在node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js
知道我缺少什么吗?