add DynamicNoteDetailed.vue
This commit is contained in:
parent
d272d6f224
commit
61019158ce
3 changed files with 44 additions and 9 deletions
40
packages/frontend/src/components/DynamicNoteDetailed.vue
Normal file
40
packages/frontend/src/components/DynamicNoteDetailed.vue
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<XNoteDetailed
|
||||
ref="rootEl"
|
||||
:note="note"
|
||||
:initialTab="initialTab"
|
||||
:expandAllCws="expandAllCws"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { computed, defineAsyncComponent, shallowRef } from 'vue';
|
||||
import type { ComponentExposed } from 'vue-component-type-helpers';
|
||||
import type MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||
import type SkNoteDetailed from '@/components/SkNoteDetailed.vue';
|
||||
import { prefer } from '@/preferences';
|
||||
|
||||
const XNoteDetailed = computed(() =>
|
||||
defineAsyncComponent(() =>
|
||||
prefer.r.noteDesign.value === 'misskey'
|
||||
? import('@/components/MkNoteDetailed.vue')
|
||||
: import('@/components/SkNoteDetailed.vue'),
|
||||
),
|
||||
);
|
||||
|
||||
const rootEl = shallowRef<ComponentExposed<typeof MkNoteDetailed | typeof SkNoteDetailed>>();
|
||||
|
||||
defineExpose({ rootEl });
|
||||
|
||||
defineProps<{
|
||||
note: Misskey.entities.Note;
|
||||
initialTab?: string;
|
||||
expandAllCws?: boolean;
|
||||
}>();
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue