forked from mattmezza/vue-beautiful-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserList.vue
60 lines (58 loc) · 1.13 KB
/
UserList.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
<div class="user-list" :style="{background: userListColor.userList.bg}">
<table style="padding-top: 5px;">
<tbody>
<tr v-for="user in participants" :key="user.id">
<td style="text-align: center;">
<img :src="user.avatar" class="img-msg" />
</td>
<td class="user-element" :style="{color: userListColor.userList.text}">
{{ user.nickname }}
</td>
</tr>
</tbody>
</table>
</div>
</template>
<script>
export default {
props: {
participants: {
type: Array,
required: true
},
colors: {
type: Object,
default: () => ({})
}
},
computed: {
userListColor() {
const defaultColors = {
userList: {
bg: '#FFFFFF',
text: '#000000'
}
}
return Object.assign(defaultColors, this.colors)
}
}
}
</script>
<style scoped>
.user-list {
height: 100%;
overflow: auto;
padding-left: 5px;
padding-top: 8px;
}
.img-msg {
border-radius: 50%;
width: 50px;
margin-right: 5px;
}
.user-element {
font-size: 20px;
vertical-align: middle;
}
</style>