<template>
  <el-col :span="24 / column" v-show="collapse">
    <el-form-item v-bind="$attrs" class="el-item" :label="label">
      <slot></slot>
    </el-form-item>
  </el-col>
</template>

<script>
export default {
  name: "CmsFormItem",
  data() {
    let { ...listeners } = this.$listeners;
    return {
      listeners: listeners,
    };
  },
  props: {
    /** 默认展开 */
    collapse: {
      type: Boolean,
      default: () => {
        return true;
      },
    },
    label: {
      type: String,
      default: ""
    },
    column: {
      type: Number,
      default: () => {
        return 2;
      },
    },
  },
};
</script>

<style scoped lang="less">
.el-form {
  .el-item {
    width: 100%;
    display: flex;
    flex-direction: row;

    .el-form-item__content {
      flex: 1;
    }
  }
}
</style>
