open links in abuse comment in new window (#13381)

* feat: changing MkA behavior from MkMFM

* chore: open links in abuse comment in new window

* docs(changelog): 通報のコメント内のリンクをクリックした際、ウィンドウで開くように

* chore: use inject instead of prop drilling

* Revert "chore: use inject instead of prop drilling"

This reverts commit b4dd14eacf.
This commit is contained in:
anatawa12
2024-04-27 21:24:39 +09:00
committed by GitHub
parent fe1172fbb6
commit 8e8ee2ac73
7 changed files with 24 additions and 4 deletions

View File

@@ -9,6 +9,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</a>
</template>
<script lang="ts">
export type MkABehavior = 'window' | 'browser' | null;
</script>
<script lang="ts" setup>
import { computed, shallowRef } from 'vue';
import * as os from '@/os.js';
@@ -20,12 +24,14 @@ import { useRouter } from '@/router/supplier.js';
const props = withDefaults(defineProps<{
to: string;
activeClass?: null | string;
behavior?: null | 'window' | 'browser';
behavior?: MkABehavior;
}>(), {
activeClass: null,
behavior: null,
});
const linkBehaviour = props.behavior;
const el = shallowRef<HTMLElement>();
defineExpose({ $el: el });