File tree 4 files changed +5
-1
lines changed
src/client/theme-default/components
4 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const props = defineProps<{
8
8
href? : string
9
9
noIcon? : boolean
10
10
target? : string
11
+ rel? : string
11
12
}>()
12
13
13
14
const isExternal = computed (() => props .href && EXTERNAL_URL_RE .test (props .href ))
@@ -20,7 +21,7 @@ const isExternal = computed(() => props.href && EXTERNAL_URL_RE.test(props.href)
20
21
:class =" { link: href }"
21
22
:href =" href ? normalizeLink(href) : undefined"
22
23
:target =" target || (isExternal ? '_blank' : undefined)"
23
- :rel =" isExternal ? 'noreferrer' : undefined"
24
+ :rel =" rel || ( isExternal ? 'noreferrer' : undefined) "
24
25
>
25
26
<slot />
26
27
<VPIconExternalLink v-if =" isExternal && !noIcon" class =" icon" />
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ const { page } = useData()
16
16
:class =" { active: isActive(page.relativePath, item.activeMatch || item.link) }"
17
17
:href =" item.link"
18
18
:target =" item.target"
19
+ :rel =" item.rel"
19
20
>
20
21
{{ item.text }}
21
22
</VPLink >
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const { page } = useData()
24
24
:href =" item.link"
25
25
:target =" item.target"
26
26
:noIcon =" true"
27
+ :rel =" item.rel"
27
28
>
28
29
{{ item.text }}
29
30
</VPLink >
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ export namespace DefaultTheme {
97
97
*/
98
98
activeMatch ?: string
99
99
target ?: string
100
+ rel ?: string
100
101
}
101
102
102
103
export type NavItemChildren = {
You can’t perform that action at this time.
0 commit comments