From 0624828e0734ea09086987c3cb036e0861929d8b Mon Sep 17 00:00:00 2001 From: Oscar Date: Mon, 29 Jul 2019 19:44:36 +0200 Subject: [PATCH] fix($theme-default): sidebarDepth: 0 not working in YAML (close: #1701) (#1702) --- .../theme-default/components/SidebarLink.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/@vuepress/theme-default/components/SidebarLink.vue b/packages/@vuepress/theme-default/components/SidebarLink.vue index 243ce7630b..bc5de287d8 100644 --- a/packages/@vuepress/theme-default/components/SidebarLink.vue +++ b/packages/@vuepress/theme-default/components/SidebarLink.vue @@ -32,12 +32,13 @@ export default { ? renderExternal(h, item.path, item.title || item.path) : renderLink(h, item.path, item.title || item.path, active) - const configDepth = $page.frontmatter.sidebarDepth - || sidebarDepth - || $themeLocaleConfig.sidebarDepth - || $themeConfig.sidebarDepth - - const maxDepth = configDepth == null ? 1 : configDepth + const maxDepth = [ + $page.frontmatter.sidebarDepth, + sidebarDepth, + $themeLocaleConfig.sidebarDepth, + $themeConfig.sidebarDepth, + 1 + ].find(depth => depth !== undefined); const displayAllHeaders = $themeLocaleConfig.displayAllHeaders || $themeConfig.displayAllHeaders