element-ui嵌套弹框遮罩层解决

:modal-append-to-body=“false” :append-to-body=“true”
嵌套的 Dialog 必须指定该属性并赋值为 true
element-ui嵌套弹框遮罩层解决_第1张图片

<template>
  <el-button type="text" @click="outerVisible = true">点击打开外层 Dialog</el-button>
  
  <el-dialog title="外层 Dialog" :visible.sync="outerVisible">
    <el-dialog
      width="30%"
      title="内层 Dialog"
      :visible.sync="innerVisible"
      :modal-append-to-body="false" :append-to-body="true" >
    </el-dialog>
    <div slot="footer" class="dialog-footer">
      <el-button @click="outerVisible = false">取 消</el-button>
      <el-button type="primary" @click="innerVisible = true">打开内层 Dialog</el-button>
    </div>
  </el-dialog>
</template>

<script>
  export default {
    data() {
      return {
        outerVisible: false,
        innerVisible: false
      };
    }
  }
</script>

你可能感兴趣的:(element-ui,ui,javascript,前端)