<template>
  <el-table
      ref="table"
      :data="tableData"
      height="400"
  >
    <slot name="header" :header="headers">
      <el-table-column
          :key="index"
          :width="header.width"
          v-for="(header, index) in headers"
          :prop="header.prop"
          :label="header.label"
      >
        <template #default="scope">
          <slot :name="header.prop" :data="scope.row" :index="scope.$index">
            {{ scope.row[header.prop] }}
          </slot>
        </template>
      </el-table-column>
    </slot>
  </el-table>
</template>

<script>
export default {
  name: "MyTable",
  props:{
    tableData: {},
    headers: {},
  }
}
</script>

<style scoped lang="scss">
</style>