element-plus/docs/examples/table-v2/empty.vue
JeremyWuuuuu 14cfb0500f
docs(components): [virtualized-table] finishing leftovers (#7496)
- Finishing the documentation examples
- Add APIs to the documentation
- Fix some issue while updating the documentations
2022-05-05 00:54:49 +08:00

30 lines
657 B
Vue

<template>
<el-table-v2
:columns="columns"
:data="[]"
:row-height="40"
:width="700"
:height="400"
:footer-height="50"
>
<template #empty>
<div class="flex items-center justify-center h-100%">
<el-empty />
</div>
</template>
</el-table-v2>
</template>
<script lang="tsx" setup>
const generateColumns = (length = 10, prefix = 'column-', props?: any) =>
Array.from({ length }).map((_, columnIndex) => ({
...props,
key: `${prefix}${columnIndex}`,
dataKey: `${prefix}${columnIndex}`,
title: `Column ${columnIndex}`,
width: 150,
}))
const columns = generateColumns(10)
</script>