首页 > 解决方案 > 为什么 html 文件中的 modal="true" 无法使用 PrimeNG 在 jhipster 中编译?

问题描述

我已经生成了一个 jhipster 应用程序,并使用 yo jhipster-primeng 将 PrimeNG 添加到其中。一切正常。但是当我想使用 ./mvnw 运行应用程序时,我在 PrimeNG .html 文件中收到以下错误。如下日志所示,错误表示,类型字符串不可分配给布尔类型。如果我们再往下看,错误来自禁用 =“true”的 .html 文件。在普通的 .html 文件中,这没有问题。为什么在这个 jhipster 应用程序中,它变成了一个错误?有没有人有任何线索。有没有办法或设置来忽略这种错误?

此致,

阿尔文。

注意:我的jhipster版本是6.10.1 generator-jhipster-primeng是9.1.0 java版本是11.0.6

[INFO]  ERROR  Failed to compile with 165 errors10:28:21 PM
[INFO] 
[INFO]  error  
[INFO] 
[INFO] src/main/webapp/app/primeng/buttons/splitbutton/splitbuttondemo.component.html:30:78 - error TS2322: Type 'string' is not assignable to type 'boolean'.
[INFO] 
[INFO] 30             <p-splitButton label="Create" icon="fa fa-check" [model]="items" disabled="true"></p-splitButton>
[INFO]                                                                                 ~~~~~~~~~~~~~~~
[INFO] 
[INFO]   src/main/webapp/app/primeng/buttons/splitbutton/splitbuttondemo.component.ts:6:18
[INFO]     6     templateUrl: './splitbuttondemo.component.html',
[INFO]                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO]     Error occurs in the template of component SplitbuttonDemoComponent.
[INFO] src/main/webapp/app/primeng/overlay/dialog/dialogdemo.component.html:16:44 - error TS2322: Type 'string' is not assignable to type 'boolean'.
[INFO] 
[INFO] 16             <p-dialog [(visible)]="custom" modal="true">
[INFO]                                               ~~~~~~~~~~~~
[INFO] 
[INFO]   src/main/webapp/app/primeng/overlay/dialog/dialogdemo.component.ts:6:18
[INFO]     6     templateUrl: './dialogdemo.component.html',
[INFO]                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO]     Error occurs in the template of component DialogDemoComponent.
[INFO] src/main/webapp/app/primeng/overlay/dialog/dialogdemo.component.html:33:63 - error TS2322: Type 'string' is not assignable to type 'boolean'.
[INFO] 
[INFO] 33             <p-dialog header="PrimeNG" [(visible)]="advanced" modal="true" [style]="{width: '50vw'}" responsive="true" closable="true" dismissableMask="true" rtl="true">
[INFO]                                                                  ~~~~~~~~~~~~
[INFO] 
[INFO]   src/main/webapp/app/primeng/overlay/dialog/dialogdemo.component.ts:6:18
[INFO]     6     templateUrl: './dialogdemo.component.html',
[INFO]                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[INFO]     Error occurs in the template of component DialogDemoComponent.
[INFO] src/main/webapp/app/primeng/overlay/dialog/dialogdemo.component.html:33:102 - error TS2322: Type 'string' is not assignable to type 'boolean'.
[INFO] 
[INFO] 33             <p-dialog header="PrimeNG" [(visible)]="advanced" modal="true" [style]="{width: '50vw'}" responsive="true" closable="true" dismissableMask="true" rtl="true">
[INFO]                                                                                                         ~~~~~~~~~~~~~~~~~
[INFO]

标签: javahtmljhipsterprimeng

解决方案


推荐阅读