<template>
    <el-col :span="configData.cols">
        <el-form-item label-width="0" :prop="prop" style="padding: 5px;box-sizing: border-box">
            <component :is="child.component" v-bind="child.props" :key="child.code" v-for="child in configData.children"></component>
        </el-form-item>
    </el-col>
</template>

<script>
export default {
    name: "spcp-col-container",
    props:{
        code:{type:String,required:true},
    },
    data(){
        return{
            configDataAll:{}, // 所有配置数据对应的json对象
            configData:{},
            prop:""
        }},

    inject:['container'],

    watch:{
        code(){
            this.init();
        }
    },

    created(){
        this.init();
    },

    methods:{
        init(){
            this.configDataAll = this.container.configDataAll || {};
            this.configData = this.configDataAll[this.code];
        }
    }
}


</script>

<style scoped>

</style>