简体   繁体   English

PrimeNG 动态对话框 - 单击即可关闭

[英]PrimeNG Dynamic Dialog - Close by click to nowhere

I use a Dynamic Dialog from PrimeNG.我使用 PrimeNG 的动态对话框

How can I force to close the dialog by clicking in the "nowhere" area around the dialog?如何通过单击对话框周围的“无处”区域来强制关闭对话框? Currently I only can close the dialog by using buttons within the dialog.目前我只能通过使用对话框中的按钮来关闭对话框。

You can use dismissableMask property to do that.您可以使用dismissableMask属性来做到这一点。

dismissableMask property specifices if clicking the modal background should hide the dialog.如果单击模态背景应隐藏对话框,则可dismissableMask属性说明。

    this.dialogService.open(ProductListDemo, {
        header: 'Choose a Product',
        width: '70%',
        contentStyle: {"max-height": "500px", "overflow": "auto"},
        baseZIndex: 10000,
        dismissableMask: true
    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM