<el-button type="text" @click="centerDialogVisible = true">点击打开 Dialog</el-button>

<el-dialog
  title="提示"
  :visible.sync="centerDialogVisible"
  width="30%"
  center>
  <span>需要注意的是内容是默认不居中的</span>

//此处插槽会替换标题栏的内容
  <span slot="title" class="dialog-footer">
      <span>这是标题</span>
     <span>这是一段信息</span>
  </span>

//此处插槽会替换按钮操作区的内容
  <span slot="footer" class="dialog-footer">
    <el-button @click="centerDialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
  </span>
</el-dialog>

<script>
  export default {
    data() {
      return {
        centerDialogVisible: false
      };
    }
  };
</script>

 

Logo

前往低代码交流专区

更多推荐