<template>
  <column v-bind="$attrs" v-on="$listeners">
    <template v-if="childrens.length">
      <template v-for="(item, index) in childrens">
        <children
          v-if="item.hide !== true"
          :key="
            item.key ||
            item.id ||
            item.field ||
            item.label ||
            item.title ||
            index
          "
          v-bind="{
            ...$attrs,
            ...item,
            indexs: index,
            ...(dragSort ? { ...item, fixed: false } : item)
          }"
          v-on="$listeners"
        ></children
      ></template>
    </template>
  </column>
</template>
<script type="text/babel">
import column from './column.vue';
export default {
  name: 'Children',
  components: {
    column
  },
  props: {
    dragSort: Boolean,
    children: Array,
    childHead: Array
  },
  created() {},
  computed: {
    childrens() {
      return this.children || this.childHead || [];
    }
  }
};
</script>
