2019-05-20 18:44:36 -05:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-07-10 01:55:10 -05: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-18 23:58:09 -05:00
|
|
|
<MkAvatar :user="user" style="width:32px; height:32px;" indicator link preview/>
|
2020-02-08 01:51:27 -06:00
|
|
|
</div>
|
2023-07-10 01:55:10 -05:00
|
|
|
<div v-if="users.length > limit" style="display: inline-block;">...</div>
|
2019-05-20 18:44:36 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-06 08:07:32 -06:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { onMounted, ref } from 'vue';
|
2021-11-11 11:02:25 -06:00
|
|
|
import * as os from '@/os';
|
2023-07-10 01:55:10 -05:00
|
|
|
import { UserLite } from 'misskey-js/built/entities';
|
2019-05-20 18:44:36 -05:00
|
|
|
|
2023-07-10 01:55:10 -05:00
|
|
|
const props = withDefaults(defineProps<{
|
2022-01-06 08:07:32 -06:00
|
|
|
userIds: string[];
|
2023-07-10 01:55:10 -05:00
|
|
|
limit?: number;
|
|
|
|
}>(), {
|
|
|
|
limit: Infinity,
|
|
|
|
});
|
2022-01-06 08:07:32 -06:00
|
|
|
|
2023-07-10 01:55:10 -05:00
|
|
|
const users = ref<UserLite[]>([]);
|
2022-01-06 08:07:32 -06:00
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
users.value = await os.api('users/show', {
|
2022-12-22 01:01:59 -06:00
|
|
|
userIds: props.userIds,
|
2023-07-10 01:55:10 -05:00
|
|
|
}) as unknown as UserLite[];
|
2019-05-20 18:44:36 -05:00
|
|
|
});
|
|
|
|
</script>
|