From 0e5519a23569f2de9f16e08daa6830dd05149b47 Mon Sep 17 00:00:00 2001 From: Franck Abgrall Date: Sat, 26 Oct 2019 06:13:22 +0200 Subject: [PATCH] fix($default-theme): deep sidebar links rendenring (#1973) --- .../theme-default/components/SidebarLink.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/@vuepress/theme-default/components/SidebarLink.vue b/packages/@vuepress/theme-default/components/SidebarLink.vue index 4efb0f2039..73fcd12e50 100644 --- a/packages/@vuepress/theme-default/components/SidebarLink.vue +++ b/packages/@vuepress/theme-default/components/SidebarLink.vue @@ -55,7 +55,7 @@ export default { } function renderLink (h, to, text, active, level) { - return h('router-link', { + const component = { props: { to, activeClass: '', @@ -64,11 +64,16 @@ function renderLink (h, to, text, active, level) { class: { active, 'sidebar-link': true - }, - style: { + } + } + + if (level > 2) { + component.style = { 'padding-left': level + 'rem' } - }, text) + } + + return h('router-link', component, text) } function renderChildren (h, children, path, route, maxDepth, depth = 1) {