Skip to content

Commit

Permalink
fix: Allow children links in toc to close the toc (#835)
Browse files Browse the repository at this point in the history
  • Loading branch information
electrolinux committed Mar 8, 2023
1 parent 27ee25f commit a3ec4be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/docs/DocsTocLinks.vue
Expand Up @@ -30,6 +30,10 @@ function scrollToHeading (id: string) {
router.push(`#${id}`)
emit('move', id)
}
function childMove(id: string) {
emit('move', id)
}
</script>

<template>
Expand All @@ -42,7 +46,7 @@ function scrollToHeading (id: string) {
>
{{ link.text }}
</a>
<DocsTocLinks v-if="link.children" :links="link.children" />
<DocsTocLinks v-if="link.children" :links="link.children" @move="childMove($event)" />
</li>
</ul>
</template>
Expand Down

0 comments on commit a3ec4be

Please sign in to comment.