empty.vue 686 B

12345678910111213141516171819202122
  1. <template>
  2. <el-table-v2 :columns="columns" :data="[]" :row-height="40" :width="700" :height="400" :footer-height="50">
  3. <template #empty>
  4. <div class="flex items-center justify-center h-100%">
  5. <el-empty />
  6. </div>
  7. </template>
  8. </el-table-v2>
  9. </template>
  10. <script lang="tsx" setup>
  11. const generateColumns = (length = 10, prefix = 'column-', props?: any) =>
  12. Array.from({ length }).map((_, columnIndex) => ({
  13. ...props,
  14. key: `${prefix}${columnIndex}`,
  15. dataKey: `${prefix}${columnIndex}`,
  16. title: `Column ${columnIndex}`,
  17. width: 150,
  18. }))
  19. const columns = generateColumns(10)
  20. </script>