<!-- form 表单 -->
<template>
  <div class="sh-form">
      <el-form  
        :model="formModel"
        v-bind="$attrs" 
        v-on="$listeners"
        :label-width="formConfig.labelWidth">
        <el-form-item 
            v-for="(item, index) in formColumns" 
            :key="index" 
            :label="item.label" 
            :prop="item.prop" 
            :rules="item.rules"
        >
            <component :is="item.component" :formModel="formModel" :item="item" ></component>
        </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name:"sh-form",
  props:{
    /**
     * 表单绑定对象
    */
    formModel: {
        type: Object,
        required: true
    },
    /**
     * 表单子项数组
    */
    formColumns: {
        type: Array,
        required: true
    },
    formConfig: {
        type: Object,
        // required: true
    }
  },
  data () {
    return {
        
    };
  },

  components: {},

  computed: {},

  creacte() {},

  mounted() {},

  methods: {}
}

</script>
<style lang='scss' scoped>
</style>