首页 > 解决方案 > p-footer 不是 p-dialog 中的已知元素错误

问题描述

在 HTML 中

<p-dialog [resizable]="false" header="Softcopy Acceptance for Ledger and 
Invoice" [(visible)]="!displaySoftCopyDialog"
[responsive]="true" showEffect="fade" [modal]="true" [width]="600">

<p style="margin: 5px; height: 305px"><span>
<span style="color:red;">GO GREEN</span><br>
Season’s Greetings! <br>
copy, they may consciously opt for the Hardcopy option.<br><br>
We wish for your consent to join us in this drive by opting for monthly 
bills through E-bill only.
</span></p>
<p-footer>
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
    <button type="submit" class="btn btn_searchSmall_add" 
(click)="remindSoftCopy()">Remind Later</button>
    <button type="submit" class="btn btn_searchSmall_add" 
(click)="acceptSoftCopy()">Accept</button>
</div>
 </p-footer>
</p-dialog>

在 ts 文件中,我从primeng设置了这两个

DialogModule,
SharedModule

在模块中,我也从primeng设置了这两个

DialogModule,
SharedModule

为什么会这样

标签: angularprimeng

解决方案


您在 package.json 文件中使用的是什么版本的 Prime NG?较旧的库 (1. . ) 不支持 p-footer 和 p-header,它从版本 2 开始包含在内。


推荐阅读