import tabsData from "../data/tabs";

export default {

    data(){
        return {
            tabsData:tabsData,
            loadings:[],
            value:0,
            first:false
        }
    },

    onLoad:function(){

        if (this.$params.select) {
            this.value = parseInt(this.$params.select);
        } else {
            this.first = true;
        }

    },

    methods:{
        /* 更改绑定 */
        bindTarget:function(detail){
            this.target[detail.type] = detail.target;
        },

        /* change的时候触发 */
        change:function(detail){
            if (detail.loading) {
                setTimeout(()=>{
                    this.$set(this.loadings,detail.index,true)
                },300);
            }

        }
    },

    created(){
        this.target = {};
    }

}