Skip to content

Commit 6a53f14

Browse files
committed
fix: ToC only with level 2 headers
1 parent 4ffbf54 commit 6a53f14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/.vuepress/theme/components/TableOfContents.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export default {
5858
const headers = computed(() => {
5959
if (!root.$page.headers) return []
6060
return root.$page.headers.map(header => {
61-
return { title: header.title, hash: header.slug }
62-
})
61+
return header.level === 2 && { title: header.title, hash: header.slug }
62+
}).filter(Boolean)
6363
})
6464
6565
onMounted(() => {

0 commit comments

Comments
 (0)