quill-image-resize-module 导入错误

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

我在我的react应用程序中使用react-quill编辑器,我需要在编辑器中调整图像大小,因为我使用“quill-image-resize-module”纱线包,但是当我在JS文件中导入这个包时,它给了我一个错误“找不到模块‘quill-image-resize-module’的声明文件。‘e:/development/React JS/stepsfrontend/node_modules/quill-image-resize-module/image-resize.min .js' 隐式具有“any”类型。 尝试

npm i --save-dev @types/quill-image-resize-module
(如果存在)或添加包含 `declare module 'quill-image-resize-module';"

的新声明 (.d.ts) 文件

从'quill-image-resize-module'导入ImageResize;

reactjs image-resizing react-quill
2个回答
0
投票

对于 React quill,我使用了“https://github.com/xeger/quill-image”这个包。请不要使用“quill-image-resize-module”包。


0
投票

您可以轻松地在项目根目录中添加新文件,例如index.d.ts

并添加 ⬇️

declare module 'quill-image-uploader' {}
declare module 'quill-image-resize-module-react' {}

我希望这对你有用

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