每当我单击按钮时,对话框都会打开,但是整个屏幕都变灰,并且我无法单击该对话框。
.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
}
});
}