指令 QuillEditorBase 中的 Ngx-Quill 错误

xDr*_*ago 6 quill angular ngx-quill

我按照基本步骤来设置 ngx-quill。经过一些研究,我还安装了 ngx-quill 和 quill。但我仍然得到同样的错误。

ERROR in Directive QuillEditorBase in .../node_modules/ngx-quill/ngx-quill.d.ts has no selector, please add it!
Cannot determine the module for class QuillEditorBase .../node_modules/ngx-quill/ngx-quill.d.ts! Add QuillEditorBase to the NgModule to fix it.
Run Code Online (Sandbox Code Playgroud)

我简单地使用 eidtor <quill-editor></quill-editor>

我使用它的组件是延迟加载的。我添加QuillModule.forRoot()到我的主模块的导入中,并尝试将其添加到我的延迟加载模块中。然后我尝试将它添加到两者中,我也尝试将它添加到没有forRoot(). 错误保持不变。我不知道应该在哪里将 QuillEditorBase 添加到 ngmodule 中。

我究竟做错了什么?我没有自定义配置。我刚刚安装了它并想尝试让它工作..

Lou*_*nda 6

我有同样的问题

Date: 2020-07-27T07:45:39.650Z - Hash: 674c36d8cc4fe0a89c1d - Time: 39499ms
ERROR in : Directive QuillEditorBase in /Users/louie/Development/mobile/node_modules/ngx-quill/ngx-quill.d.ts has no selector, please add it!
: Cannot determine the module for class QuillEditorBase in /Users/louie/Development/mobile/node_modules/ngx-quill/ngx-quill.d.ts! Add QuillEditorBase to the NgModule to fix it.
[ERROR] An error occurred while running subprocess ng.
Run Code Online (Sandbox Code Playgroud)

因为我使用的是带有 Angular~8.1.2"^1.3.7""quill ": 的Ionic Cordova 4 ,"ngx-quill": "^12.0.0"

我检查了 quill 的文档并找到了这个。

Compatibility to Angular Versions
Angular ngx-quill   supported
v10 >= 12.0.0   until Feb 24, 2022
v9  >= 8.0.0    until Aug 06, 2021
v8  >= 5.2.0, < 9   until Nov 28, 2020
Run Code Online (Sandbox Code Playgroud)

所以,为了解决我遇到的问题。我从降级NGX-鹅毛笔v12.0.05.2.0。然后它编译成功。


xDr*_*ago 0

感谢@bryan60 的提示。确实是版本不匹配。我安装了最新版本的 quill,但在 Angular 8 上运行,它需要 quill 版本 < 10,并在他们的文档中提到。我更新到 Angular 9 并且它有效。