feat(docs): align documentation shell with HeroUI baseline

This commit is contained in:
maoyingjie
2026-10-24 07:18:36 +08:00
parent 406497a20f
commit b2246f0058
33 changed files with 2499 additions and 1540 deletions
@@ -0,0 +1,36 @@
<script setup lang="ts">
import { computed } from "vue";
import { Card, CardTitle, CardDescription } from "@heroui-vue/components";
import { withBase } from "vitepress";
import { IconArrowUpRight } from "@tabler/icons-vue";
import { searchIndex } from "virtual:docs-data";
import { componentItems } from "./navigation";
const props = defineProps<{ category: string }>();
const items = computed(() =>
componentItems.filter((item) => item.category === props.category),
);
function description(url: string) {
return (
searchIndex.find((entry) => entry.url === url && entry.section === "概览")
?.text ?? "查看组件用法与 API"
);
}
</script>
<template>
<div class="components-grid not-prose">
<Card
v-for="item in items"
:key="item.url"
as="a"
:href="withBase(item.url)"
class="component-index-card"
variant="transparent"
>
<CardTitle>
{{ item.title }}
<IconArrowUpRight aria-hidden="true" :size="16" />
</CardTitle>
<CardDescription>{{ description(item.url) }}</CardDescription>
</Card>
</div>
</template>