<template>
<div class="api-table">
  <h3>{{api.name}}</h3>
  <el-tabs>
    <el-tab-pane value="0" :label="k" :name="i + ''" v-for="(v, k, i) in api.content" :key="k">
      <el-table :data="v" style="width: 100%">
        <el-table-column v-for="(value, key) in v[0]" :key="key" :prop="key" :label="key"></el-table-column>
      </el-table>
    </el-tab-pane>
  </el-tabs>
</div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import { CompApi } from '@/config/components/type'

@Component
export default class ApiTable extends Vue {
  @Prop() api!: CompApi
}
</script>

<style lang="scss">
.api-table {
  margin-top: 32px;
}
</style>
