1.在el-dialog标签中使用
<el-dialog title="啊哈哈哈" :visible.sync="sign" :close-on-click-modal="false"
</el-dialog>
2.全局使用(在main.js中)
import ElementUI from 'element-ui';
// el-dialog 默认点击遮照为不关闭
ElementUI.Dialog.props.closeOnClickModal.default = false
3.在关闭弹框时清除在弹框中的验证
handleClose() {
this.sign= false;
this.$refs.editor.resetFields();
}
4.弹框遮罩层
<el-dialog
title="删除系统"
:modal="true"
:modal-append-to-body="false"
>
</el-dialog>
5.弹框样式居中
/deep/ .el-dialog {
display: flex;
flex-direction: column;
margin: 0 !important;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-height:90vh;
}
/deep/ .el-dialog .el-dialog__body{
border-top: 1px solid #dcdfe6;
border-bottom: 1px solid #dcdfe6;
max-height:85% !important;
min-height: 70%;
overflow-y: auto;
flex:1;
}