<template>
  <div>
    <el-dialog
      center
      :visible.sync="dialogVisible"
      width="30%"
      show-close
      @closed="cancelSubmit"
    >
      <slot name="content"></slot>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancelSubmit">取 消</el-button>
        <el-button type="primary" @click="onSubmit" :loading="loading"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return { dialogVisible: false, loading: false }
  },
  watch: {},
  mounted() {},
  methods: {
    cancelSubmit() {
      this.dialogVisible = false
      this.$emit("onCancel")
    },
    onSubmit() {
      this.$emit("onSubmit")
    },
  },
}
</script>
<style lang="scss" scoped></style>
