Skip to content

Commit 0e5519a

Browse files
kefranabgmeteorlxy
authored andcommitted
fix($default-theme): deep sidebar links rendenring (#1973)
1 parent 98977c9 commit 0e5519a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/@vuepress/theme-default/components/SidebarLink.vue

+9-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default {
5555
}
5656
5757
function renderLink (h, to, text, active, level) {
58-
return h('router-link', {
58+
const component = {
5959
props: {
6060
to,
6161
activeClass: '',
@@ -64,11 +64,16 @@ function renderLink (h, to, text, active, level) {
6464
class: {
6565
active,
6666
'sidebar-link': true
67-
},
68-
style: {
67+
}
68+
}
69+
70+
if (level > 2) {
71+
component.style = {
6972
'padding-left': level + 'rem'
7073
}
71-
}, text)
74+
}
75+
76+
return h('router-link', component, text)
7277
}
7378
7479
function renderChildren (h, children, path, route, maxDepth, depth = 1) {

0 commit comments

Comments
 (0)