Angular MatDialog 不显示灰色背景覆盖 [英] Angular MatDialog not showing the gray background overlay
本文介绍了Angular MatDialog 不显示灰色背景覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是 Angular 6.我已经包含了主题.我是这样打开的:
I am using Angular 6. I've already included the theme. I am opening it like this:
constructor(private dialogo: MatDialog) {
}
ngOnInit() {
this.dialogo.open(CarregandoComponent);
}
这是我的对话框的图片,在对话框外单击不会关闭它.按 esc 将关闭对话框.
Here is picture of my dialog, clicking outside the dialog won't close it. Pressing esc will dismiss the dialog.
推荐答案
另一种可能的解决方案
你只需要包含 @import '~@angular/cdk/overlay-prebuilt.css';
或者取决于您如何使用 CDK 此处的另一个解决方案 https://material.angular.io/cdk/overlay/概览
or depend on how you are using CDK another solution here https://material.angular.io/cdk/overlay/overview
这篇关于Angular MatDialog 不显示灰色背景覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文