<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogVisible"
    :width="width"
    :before-close="editClose">
    <slot></slot>
    <span slot="footer" class="dialog-footer" v-if="isSubmit">
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="subAdmin">确 定</el-button>
        </span>
  </el-dialog>
</template>


<script>
    export default {
        name: "ui-dialog",
        computed: {},
        props:{
            title:{
                default:'弹出框',
                type:String
            },
            width:{
                default:"30%",
                type:String
            },
            isSubmit:{
                default : true,
                type:Boolean
            }
        },
        data() {
            return {
                dialogVisible:false
            }
        },
        created() {

        },
        methods: {
            editClose:function () {
                this.dialogVisible = false;
            },
            show(){
                this.dialogVisible = true;
            },
            hide(){
                this.dialogVisible = false;
            },
            /**
             * 提交数据
             */
            subAdmin:function () {
                this.$emit("onSumbit",{});
            }
        }
    }
</script>
<style scoped>

</style>
