<template>
    <ul class="select-list-wrap J-select-tab-cnt" v-show="visible">
        <slot></slot>
    </ul>
</template>

<script>
    export default {
        name: "focusSelectTab",
        componentName: "focusSelectTab",

        inject: ["select"],

        props: {
            label: {
                type: String,
                required: true
            },
            active: Boolean
        },

        data(){
            return {
                visible: this.active
            }
        },

        created() {
            this.select.tabs.push(this);
        },

        beforeDestroy() {
            this.select.onSelectTabDestroy(this.select.tabs.indexOf(this));
        }
    }
</script>