PrimeNG 确认对话框忽略某些属性,如可关闭或关闭转义



所以在这里我有一个简单的确认对话框

                            <p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425" closeable="false" closeOnEscape="false" #cd>
                                <p-footer>
                                    <button type="button" pButton icon="fa-close" label="No" (click)="cd.reject()"></button>
                                    <button type="button" pButton icon="fa-check" label="Yes" (click)="cd.accept()"></button>
                                </p-footer>
                            </p-confirmDialog>

但是,由于我不知道的原因,对话框呈现关闭按钮并在按 ESC 键时关闭。为什么忽略closeablecloseOnEscape属性?只有widthhight属性对我有用。

closeable="false" closeOnEscape="false"替换为[closeable]="false" [closeOnEscape]="false"

最新更新