Create EmA.vue

This commit is contained in:
syuilo 2024-08-23 08:28:42 +09:00
parent dd8ab655a9
commit a5f40891c7
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<!--
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>