<template>
    <Modal :title="title" :value="true" :closable="false" :mask-closable="false" @on-ok="onOK" @on-cancel="onCancel" :width="width">
        <slot>没有数据</slot>
        <div slot="footer">
            <Button type="primary" size="large" @click="onOK">关闭</Button>
        </div>
    </Modal>
</template>
<script>
export default {
    name: 'ModalForm',
    data() {
        return {}
    },
    props: {
        title: {
            type: String
        }, 
        width: {
            type: Number,
            default: 520
        }
    },
    computed: {},
    components: {},
    methods: {
        onCancel() {
            this.remove();
        },
        onOK() {
            this.remove();
        },
        remove() {
            setTimeout(() => {
                this.destroy();
            }, 300);
        },
        destroy() {
            this.$destroy();
            document.body.removeChild(this.$el);
        }
    }
};

</script>
<style>
</style>
