feat(docs): align documentation shell with HeroUI baseline
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user