mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 04:33:50 +01:00
refactor(client): use composition api
This commit is contained in:
parent
ab4853c0d5
commit
5a23c59083
@ -1,30 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-for="user in us" :key="user.id" style="display:inline-block;width:32px;height:32px;margin-right:8px;">
|
<div v-for="user in users" :key="user.id" style="display:inline-block;width:32px;height:32px;margin-right:8px;">
|
||||||
<MkAvatar :user="user" style="width:32px;height:32px;" :show-indicator="true"/>
|
<MkAvatar :user="user" style="width:32px;height:32px;" :show-indicator="true"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
|
|
||||||
export default defineComponent({
|
const props = defineProps<{
|
||||||
props: {
|
userIds: string[];
|
||||||
userIds: {
|
}>();
|
||||||
required: true
|
|
||||||
},
|
const users = ref([]);
|
||||||
},
|
|
||||||
data() {
|
onMounted(async () => {
|
||||||
return {
|
users.value = await os.api('users/show', {
|
||||||
us: []
|
userIds: props.userIds
|
||||||
};
|
});
|
||||||
},
|
|
||||||
async created() {
|
|
||||||
this.us = await os.api('users/show', {
|
|
||||||
userIds: this.userIds
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user