Files
heroui-vue/apps/docs/demos/table-empty-state.vue
T

38 lines
1.1 KiB
Vue

<script setup lang="ts">
import { IconInbox } from "@tabler/icons-vue";
import {
EmptyState,
Table,
TableBody,
TableColumn,
TableContent,
TableHeader,
TableScrollContainer,
} from "@heroui-vue/components";
</script>
<template>
<Table class="min-h-[200px]">
<TableScrollContainer>
<TableContent aria-label="空表格" class="h-full min-w-[600px]">
<TableHeader>
<TableColumn is-row-header>姓名</TableColumn>
<TableColumn>角色</TableColumn>
<TableColumn>状态</TableColumn>
<TableColumn>邮箱</TableColumn>
</TableHeader>
<TableBody :colspan="4">
<template #empty>
<EmptyState
class="flex h-full w-full flex-col items-center justify-center gap-4 text-center"
>
<IconInbox class="size-6 text-muted" aria-hidden="true" />
<span class="text-sm text-muted">未找到结果</span>
</EmptyState>
</template>
</TableBody>
</TableContent>
</TableScrollContainer>
</Table>
</template>