docs/.vitepress/theme/components/LinkInline.vue

19658844f94aba0e175f26e88ee51c22b753b2ce
wotaku/docs/.vitepress/theme/components/LinkInline.vue
taskylizard fix oopsie, format5b7264f968 1 year ago

40 lines · 908 bytes

 1<script setup lang="ts">
 2import { Tooltip } from 'floating-vue'
 3import { withBase } from 'vitepress'
 4
 5defineProps<{
 6  title: string
 7  link: string
 8  target?: string
 9  description: string
10}>()
11</script>
12
13<template>
14  <span class="sr-only">{{ title }}</span>
15  <ClientOnly>
16    <Tooltip class="inline-block" theme="twoslash">
17      <a
18        :href="withBase(link)"
19        :target
20        class="bg-$vp-c-default-soft hover:bg-$vp-c-brand-soft/25 rounded px2 py1 decoration-none!"
21      >
22        {{ title }}
23      </a>
24
25      <template #popper>
26        <a :href="withBase(link)" :target flex flex-col p4 gap-2 max-w-100>
27          <div flex gap-2>
28            <div>
29              {{ title }}
30            </div>
31            <div flex-grow />
32          </div>
33          <div op75 text-sm>
34            {{ description }}
35          </div>
36        </a>
37      </template>
38    </Tooltip>
39  </ClientOnly>
40</template>
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form