我想在Angular 9中使用ckeditor,我按照https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/angular.html中的说明进行操作,但在导入'@ckeditor/ckeditor5-build-classic'时出现错误。
Could not find a declaration file for module '@ckeditor/ckeditor5-build-classic'.
'a:/repositories/BasimStore/source/Web/Frontend/node_modules/@ckeditor/ckeditor5-build-classic/build/ckeditor.js' implicitly has an 'any' type.
Try `npm install @types/ckeditor__ckeditor5-build-classic` if it exists or add a new declaration (.d.ts) file containing `declare module '@ckeditor/ckeditor5-build-classic';`
我的 package.json 文件里有 "@ckeditor/ckeditor5-angular": "^1.2.3" 和 "@ckeditor/ckeditor5-build-classic": "^20.0.0",但还是显示出错信息。 我在 ckeditor5-build-classic 文件夹中找不到 index.d.ts 文件。如何解决这个错误?
import * as ClassicEditorBuild from '@ckeditor/ckeditor5-build-classic'; export class x implements OnInit { public Editor = ClassicEditorBuild;constructor() { } ngOnInit(): void {}}
最后,在您的 x.component.html 中添加以下代码
- sid7747