Sharkey/packages/frontend/src/components/MkAvatars.vue
おさむのひと fa9c4a19b9
refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる (#12694)
* refactor(frontend): os.tsに引き込んだscripts/api.tsの再exportをやめる

* fix

* fix

* renate to "misskeyApi"

* rename file
2024-01-04 18:32:46 +09:00

34 lines
923 B
Vue

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div>
<div v-for="user in users.slice(0, limit)" :key="user.id" style="display:inline-block;width:32px;height:32px;margin-right:8px;">
<MkAvatar :user="user" style="width:32px; height:32px;" indicator link preview/>
</div>
<div v-if="users.length > limit" style="display: inline-block;">...</div>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { misskeyApi } from '@/scripts/misskey-api.js';
const props = withDefaults(defineProps<{
userIds: string[];
limit?: number;
}>(), {
limit: Infinity,
});
const users = ref<Misskey.entities.UserLite[]>([]);
onMounted(async () => {
users.value = await misskeyApi('users/show', {
userIds: props.userIds,
}) as unknown as Misskey.entities.UserLite[];
});
</script>