<template>
  <component
    :is="comTable.tableColumnName"
    :prop="columnOption.prop"
    :key="columnOption.prop"
    :label="columnOption.label"
    :show-overflow-tooltip="columnOption.overHidden"
    :align="columnOption.align || comTable.tableOption.align"
  >
    <template v-for="column in columnOption.children">
      <column-dynamic
        v-if="column.children && column.children.length > 0"
        :key="column.label"
        :columnOption="column"
      ></column-dynamic>
      <column-slot
        v-else
        :column="column"
        :column-option="columnOption.children"
        :key="column.id"
      ></column-slot>
    </template>
  </component>
</template>

<script>
import columnSlot from './column-slot';
export default {
  name: 'column-dynamic',
  components: {
    columnSlot,
  },
  inject: ['comTable'],
  props: {
    columnOption: Object,
  },
  created() {},
};
</script>
