0

每当我单击按钮时,对话框正在打开,但整个屏幕变灰,我无法单击对话框。

.html 文件

<p-confirmDialog header="Confirmation" icon="pi pi-exclamation-triangle"> 

<button type="text" (click)="confirm()" pButton icon="pi pi-check" 
label="Confirm"></button>

.ts 文件

constructor(private confirmationService: ConfirmationService) {}

confirm() {
this.confirmationService.confirm({
    message: 'Are you sure that you want to perform this action?',
    accept: () => {
        //Actual logic to perform a confirmation
    }
});
}

单击此处查看对话框是如何呈现的

4

0 回答 0