traxxx-web/components/link/link.vue

22 lines
317 B
Vue
Raw Normal View History

<template>
<a
:class="{ active: pageContext.urlPathname === $attrs.href || active }"
rel="noopener noreferrer"
>
<slot />
</a>
</template>
<script setup>
import { inject } from 'vue';
defineProps({
active: {
type: Boolean,
default: false,
},
});
const pageContext = inject('pageContext');
</script>