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