@@ -20,17 +20,19 @@ const {
20
20
toggle
21
21
} = useSidebarControl (computed (() => props .item ))
22
22
23
- const sectionTag = computed (() => hasChildren .value ? ' section' : ` div ` )
23
+ const sectionTag = computed (() => ( hasChildren .value ? ' section' : ` div ` ) )
24
24
25
- const linkTag = computed (() => isLink .value ? ' a' : ' div' )
25
+ const linkTag = computed (() => ( isLink .value ? ' a' : ' div' ) )
26
26
27
27
const textTag = computed (() => {
28
28
return ! hasChildren .value
29
29
? ' p'
30
- : props .depth + 2 === 7 ? ' p' : ` h${props .depth + 2 } `
30
+ : props .depth + 2 === 7
31
+ ? ' p'
32
+ : ` h${props .depth + 2 } `
31
33
})
32
34
33
- const itemRole = computed (() => isLink .value ? undefined : ' button' )
35
+ const itemRole = computed (() => ( isLink .value ? undefined : ' button' ) )
34
36
35
37
const classes = computed (() => [
36
38
[` level-${props .depth } ` ],
@@ -55,20 +57,33 @@ function onCaretClick() {
55
57
56
58
<template >
57
59
<component :is =" sectionTag" class =" VPSidebarItem" :class =" classes" >
58
- <div v-if =" item.text"
60
+ <div
61
+ v-if =" item.text"
59
62
class =" item"
60
63
:role =" itemRole"
61
- v-on =" item.items ? { click: onItemInteraction, keydown: onItemInteraction } : {}"
64
+ v-on ="
65
+ item.items
66
+ ? { click: onItemInteraction, keydown: onItemInteraction }
67
+ : {}
68
+ "
62
69
:tabindex =" item.items && 0"
63
70
>
64
71
<div class =" indicator" />
65
72
66
- <VPLink v-if =" item.link" :tag =" linkTag" class =" link" :href =" item.link" >
73
+ <VPLink
74
+ v-if =" item.link"
75
+ :tag =" linkTag"
76
+ class =" link"
77
+ :href =" item.link"
78
+ :rel =" item.rel"
79
+ :target =" item.target"
80
+ >
67
81
<component :is =" textTag" class =" text" v-html =" item.text" />
68
82
</VPLink >
69
83
<component v-else :is =" textTag" class =" text" v-html =" item.text" />
70
84
71
- <div v-if =" item.collapsed != null"
85
+ <div
86
+ v-if =" item.collapsed != null"
72
87
class =" caret"
73
88
role =" button"
74
89
aria-label =" toggle section"
0 commit comments