empty.vue 657 B

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