1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-23 02:58:18 +09:00
MisskeyIO/packages/frontend/src/components/MkAvatars.vue

35 lines
895 B
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
2019-05-21 08:44:36 +09:00
<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;">
2023-05-19 13:58:09 +09:00
<MkAvatar :user="user" style="width:32px; height:32px;" indicator link preview/>
2020-02-08 16:51:27 +09:00
</div>
<div v-if="users.length > limit" style="display: inline-block;">...</div>
2019-05-21 08:44:36 +09:00
</div>
</template>
2022-01-06 23:07:32 +09:00
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as Misskey from 'misskey-js';
2023-09-19 16:37:43 +09:00
import * as os from '@/os.js';
2019-05-21 08:44:36 +09:00
const props = withDefaults(defineProps<{
2022-01-06 23:07:32 +09:00
userIds: string[];
limit?: number;
}>(), {
limit: Infinity,
});
2022-01-06 23:07:32 +09:00
const users = ref<Misskey.entities.UserLite[]>([]);
2022-01-06 23:07:32 +09:00
onMounted(async () => {
users.value = await os.api('users/show', {
userIds: props.userIds,
}) as unknown as Misskey.entities.UserLite[];
2019-05-21 08:44:36 +09:00
});
</script>