Skip to content

Commit b974ac7

Browse files
author
jannik.lange
committed
✨ added muclink component #182
1 parent 3ff0acc commit b974ac7

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/components/Link/MucLink.vue

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<template>
2+
<a
3+
:href="href"
4+
:target="target"
5+
class="m-link"
6+
:class="reversedUnderlineClass"
7+
>
8+
{{ label }}
9+
<slot name="icon">
10+
<muc-icon
11+
v-if="icon"
12+
:icon="icon"
13+
class="icon icon--after"
14+
/>
15+
</slot>
16+
</a>
17+
</template>
18+
19+
<script setup lang="ts">
20+
import { computed } from "vue";
21+
22+
import { MucIcon } from "../Icon";
23+
24+
const props = withDefaults(
25+
defineProps<{
26+
label: string;
27+
href?: string;
28+
icon?: string;
29+
target?: string;
30+
noUnderline?: boolean;
31+
}>(),
32+
{
33+
noUnderline: false,
34+
href: "#",
35+
target: "_blank",
36+
}
37+
);
38+
39+
const reversedUnderlineClass = computed(() =>
40+
props.noUnderline ? "m-link--reversed-underline" : ""
41+
);
42+
</script>
43+
44+
<style scoped></style>

0 commit comments

Comments
 (0)