我试图在单击对话框外部时隐藏对话框,但无法使用 PrimeNG 中的 dismissabeMask 来实现。有人可以帮我吗?
超文本标记语言
<button type="text" (click)="showDialog()" pButton icon="fa-external-link-square" label="Show"></button>
<p-dialog [(visible)]="display" [(dismissableMask)]="mask">
<p-header>
Error Message
</p-header>
<label>Label</label>
<p-footer>
</p-footer>
</p-dialog
Run Code Online (Sandbox Code Playgroud)
TS
mask: boolean = false;
showDialog() {
this.msg = this.errorMessages[id];
this.display = true;
this.mask = true;
}
Run Code Online (Sandbox Code Playgroud)