Files
misskey/packages/frontend-embed/src/components/EmA.vue
syuilo d6f81fd3b3 wip
2024-08-23 12:47:22 +09:00

30 lines
521 B
Vue

<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<a ref="el" :href="to" @click.prevent="nav">
<slot></slot>
</a>
</template>
<script lang="ts" setup>
import { computed, inject, shallowRef } from 'vue';
const props = withDefaults(defineProps<{
to: string;
activeClass?: null | string;
}>(), {
activeClass: null,
});
const el = shallowRef<HTMLElement>();
defineExpose({ $el: el });
function nav(ev: MouseEvent) {
location.href = props.to;
}
</script>