Skip to content

Commit 52e3027

Browse files
committed
feat: toc show 2 level
fix #306
1 parent 642b05f commit 52e3027

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/prose/nav/ProseNavToc.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ function activeClass(id: string): string {
2121
<ProseNavGroupLink :to="`#${link.id}`" :class="activeClass(link.id)">
2222
{{ link.text }}
2323
</ProseNavGroupLink>
24+
<ol v-if="link.children" class="ml-4 text-gray-500 dark:text-gray-400">
25+
<li v-for="child in link.children" :key="child.id">
26+
<ProseNavGroupLink :to="`#${child.id}`" :class="activeClass(child.id)">
27+
{{ child.text }}
28+
</ProseNavGroupLink>
29+
</li>
30+
</ol>
2431
</li>
2532
</ol>
2633
</template>

0 commit comments

Comments
 (0)