vue中使用el-dialog设置弹窗对话框在前端显示为居中

废话不多直接上图

在所需要设置的vue文件底部设置

vue中使用el-dialog设置弹窗对话框在前端显示为居中

附上代码:

   

    ::v-deep .el-dialog{

  display: flex;

  flex-direction: column;

  margin:0 !important;

  position:absolute;

  top:50%;

  left:50%;

  transform:translate(-50%,-50%);

  max-height:calc(100% – 30px);

  max-width:calc(100% – 30px);

}

::v-deep  .el-dialog .el-dialog__body{

  flex:1;

  overflow: auto;

}

本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/803a98956d.html