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
+33
View File
@@ -0,0 +1,33 @@
<script setup lang="ts">
import { Link } from "@heroui-vue/components";
interface TocEntry {
title: string;
slug: string;
children?: TocEntry[];
}
defineProps<{ headers: TocEntry[]; active: string }>();
const emit = defineEmits<{ navigate: [slug: string, event: MouseEvent] }>();
</script>
<template>
<nav class="toc-links" aria-label="本页目录">
<template v-for="heading in headers" :key="heading.slug">
<Link
:href="'#' + heading.slug"
:aria-current="active === heading.slug ? 'location' : undefined"
@click="emit('navigate', heading.slug, $event)"
>
{{ heading.title }}
</Link>
<Link
v-for="child in heading.children"
:key="child.slug"
class="nested"
:href="'#' + child.slug"
:aria-current="active === child.slug ? 'location' : undefined"
@click="emit('navigate', child.slug, $event)"
>
{{ child.title }}
</Link>
</template>
</nav>
</template>