Files
heroui-vue/apps/docs/demos/table-custom-styles.vue

56 lines
1.7 KiB
Vue

<script setup lang="ts">
import {
Table,
TableBody,
TableCell,
TableColumn,
TableContent,
TableHeader,
TableRow,
TableScrollContainer,
} from "@heroui-vue/components";
const headerCell = "text-xs font-semibold uppercase tracking-wide text-muted";
const rowClass =
"border-t border-border/60 transition-colors hover:bg-default even:bg-surface-secondary";
</script>
<template>
<Table
class="w-full max-w-2xl overflow-hidden rounded-xl border border-border/80 shadow-sm"
>
<TableScrollContainer>
<TableContent aria-label="团队成员" class="min-w-[600px]">
<TableHeader class="bg-surface-secondary">
<TableColumn is-row-header :class="headerCell">姓名</TableColumn>
<TableColumn :class="headerCell">角色</TableColumn>
<TableColumn :class="headerCell">状态</TableColumn>
</TableHeader>
<TableBody>
<TableRow row-key="1" :class="rowClass">
<TableCell class="font-medium text-foreground">
Kate Moore
</TableCell>
<TableCell>CEO</TableCell>
<TableCell>在职</TableCell>
</TableRow>
<TableRow row-key="2" :class="rowClass">
<TableCell class="font-medium text-foreground">
John Smith
</TableCell>
<TableCell>CTO</TableCell>
<TableCell>在职</TableCell>
</TableRow>
<TableRow row-key="3" :class="rowClass">
<TableCell class="font-medium text-foreground">
Sara Johnson
</TableCell>
<TableCell>CMO</TableCell>
<TableCell>休假中</TableCell>
</TableRow>
</TableBody>
</TableContent>
</TableScrollContainer>
</Table>
</template>