Skip to content

Commit 60e2ee9

Browse files
authored
docs(Header): add GitHub link in mobile menu (#3721)
1 parent 7f1c6ca commit 60e2ee9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/app/components/Header.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,20 @@ onMounted(() => {
2222
2323
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
2424
25+
const githubLink = computed(() => {
26+
return `https://github.com/nuxt/${value.value}`
27+
})
28+
2529
const desktopLinks = computed(() => props.links.map(({ icon, ...link }) => link))
26-
const mobileLinks = computed(() => props.links.map(link => ({ ...link, defaultOpen: link.children && route.path.startsWith(link.to as string) })))
30+
const mobileLinks = computed(() => [
31+
...props.links.map(link => ({ ...link, defaultOpen: link.children && route.path.startsWith(link.to as string) })),
32+
{
33+
label: 'Open on GitHub',
34+
to: githubLink.value,
35+
icon: 'i-simple-icons-github',
36+
target: '_blank'
37+
}
38+
])
2739
</script>
2840

2941
<template>
@@ -73,7 +85,7 @@ const mobileLinks = computed(() => props.links.map(link => ({ ...link, defaultOp
7385
:key="value"
7486
color="neutral"
7587
variant="ghost"
76-
:to="`https://github.com/nuxt/${value}`"
88+
:to="githubLink"
7789
target="_blank"
7890
icon="i-simple-icons-github"
7991
aria-label="GitHub"

0 commit comments

Comments
 (0)