<template>
  <el-table-column v-if="!isLeaf" :label="column.label" header-align="center">
    <template v-for="child in column.children">
      <table-column :key="child.label" :column="child" />
    </template>
  </el-table-column>
  <el-table-column v-else :label="column.label" :prop="column.prop" header-align="center"/>
</template>

<script>
export default {
  name: 'TableColumn',
  props: {
    column: Object
  },
  created() {
    // console.log(this.column,9999);
  },
  computed: {
    isLeaf() {
      return !this.column.children || this.column.children.length === 0;
    }
  }
}
</script>
