From 13264c9fc1e1a8f69f9e1ec0b7ebbf3beba259c1 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 3 Sep 2022 11:11:32 +0530 Subject: [PATCH] fix: don't nest sidebar links --- .../components/VPSidebarLink.vue | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/client/theme-default/components/VPSidebarLink.vue b/src/client/theme-default/components/VPSidebarLink.vue index e4885502f857..330790eb99c9 100644 --- a/src/client/theme-default/components/VPSidebarLink.vue +++ b/src/client/theme-default/components/VPSidebarLink.vue @@ -5,29 +5,35 @@ import { useData } from 'vitepress' import { isActive } from '../support/utils.js' import VPLink from './VPLink.vue' -withDefaults(defineProps<{ item: DefaultTheme.SidebarItem; depth?: number }>(), { depth: 1 }) +withDefaults( + defineProps<{ item: DefaultTheme.SidebarItem; depth?: number }>(), + { depth: 1 } +) const { page, frontmatter } = useData() -const maxDepth = computed(() => frontmatter.value.sidebarDepth || Infinity) +const maxDepth = computed( + () => frontmatter.value.sidebarDepth || Infinity +) const closeSideBar = inject('close-sidebar') as () => void