don't await in <setup>
`defineAsyncComponent` exists for exactly this purpose…
This commit is contained in:
parent
513a8e5de4
commit
385ecc30a3
5 changed files with 29 additions and 23 deletions
|
|
@ -32,17 +32,18 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { shallowRef, ref } from 'vue';
|
||||
import { defineAsyncComponent, shallowRef, ref } from 'vue';
|
||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
||||
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { infoImageUrl } from '@/instance.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
const MkNote = (
|
||||
(defaultStore.state.noteDesign === 'misskey') ? (await import('@/components/MkNote.vue')).default :
|
||||
(defaultStore.state.noteDesign === 'sharkey') ? (await import('@/components/SkNote.vue')).default :
|
||||
null);
|
||||
const MkNote = defineAsyncComponent(() =>
|
||||
(defaultStore.state.noteDesign === 'misskey') ? import('@/components/MkNote.vue') :
|
||||
(defaultStore.state.noteDesign === 'sharkey') ? import('@/components/SkNote.vue') :
|
||||
null
|
||||
);
|
||||
|
||||
const props = defineProps<{
|
||||
pagination: Paging;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue