28 lines
481 B
Vue
28 lines
481 B
Vue
<script setup lang="ts">
|
|
interface Props {
|
|
to: string
|
|
target?: string
|
|
class?: string
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
target: '',
|
|
class: '',
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<a
|
|
v-if="props.target === '_blank'"
|
|
v-bind="$attrs"
|
|
:href="props.to"
|
|
:target="props.target"
|
|
:class="props.class"
|
|
>
|
|
<slot />
|
|
</a>
|
|
<AtomsLocaleLink v-else v-bind="$attrs" :to="props.to" :class="props.class">
|
|
<slot />
|
|
</AtomsLocaleLink>
|
|
</template>
|