export default {

    data(){
        return {
            value: true
        }
    },

    methods:{

        close(){
            if (this.value) {

                if (typeof this.$attrs.onclose === 'function') {
                    this.$attrs.onclose();
                }

                this.value = false;
            }
        }

    },

    beforeUnmount() {
        return this.close();
    }

}