角度MatDialog不显示灰色背景覆盖 [英] Angular MatDialog not showing the gray background overlay
本文介绍了角度MatDialog不显示灰色背景覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Angular6.我已经包含了主题.我是这样打开的:
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/overview
or depend on how you are using CDK another solution here https://material.angular.io/cdk/overlay/overview
这篇关于角度MatDialog不显示灰色背景覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文