项目中elementUI的dialog遇到的小bug 点击遮罩层不会关闭
bug : 点击项目中elementUI的dialog遇到的小bug 点击遮罩层不会关闭
bug 原因: 因为自己在 dialog 加了样式,导致其不能正常关闭,
解决办法:将自己样式删除,采用下面的居中样式(因为能满足我的需求了)
饿了么UI框架中的说明:
将center设置为true即可使标题和底部居中。center仅影响标题和底部区域。Dialog 的内容是任意的,在一些情况下,内容并不适合居中布局。如果需要内容也水平居中,请自行为其添加 CSS。
.el-dialog{
display: flex;
flex-direction: column;
margin:0 !important;
position:absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
/*height:600px;*/
max-height:calc(100% - 30px);
max-width:calc(100% - 30px);
}
.el-dialog .el-dialog__body{
flex:1;
overflow: auto;
}