We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 448a69e commit 95ac3a2Copy full SHA for 95ac3a2
1 file changed
src/components/Link.vue
@@ -0,0 +1,26 @@
1
+<script setup lang="ts">
2
+import { computed, useAttrs } from 'vue'
3
+import { twMerge } from 'tailwind-merge'
4
+
5
+defineOptions({ inheritAttrs: false })
6
7
+defineProps({
8
+ /**
9
+ * The URL the link points to.
10
+ */
11
+ href: {
12
+ type: String,
13
+ required: true,
14
+ validator: (v: string) => v.trim().length > 0,
15
+ },
16
+})
17
18
+const attrs = useAttrs()
19
+const mergedClass = computed(() => twMerge('no-underline', attrs.class as string))
20
+</script>
21
22
+<template>
23
+ <a :href="href" v-bind="$attrs" :class="mergedClass">
24
+ <slot />
25
+ </a>
26
+</template>
0 commit comments