index.vue
2.89 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<script setup>
const router = useRoute('pages-user-profile-tab')
const teamData = ref([])
const fetchTeamData = async () => {
if (router.params.tab === 'teams') {
const data = await $api('/pages/profile', { query: { tab: router.params.tab } }).catch(err => console.log(err))
teamData.value = data
}
}
watch(router, fetchTeamData, { immediate: true })
const moreList = [
{
title: 'Rename Project',
value: 'Rename Project',
},
{
title: 'View Details',
value: 'View Details',
},
{
title: 'Add to favorites',
value: 'Add to favorites',
},
{
type: 'divider',
class: 'my-2',
},
{
title: 'Leave Project',
value: 'Leave Project',
class: 'text-error',
},
]
</script>
<template>
<VRow v-if="teamData">
<VCol
v-for="team in teamData"
:key="team.title"
cols="12"
md="6"
lg="4"
>
<VCard>
<VCardItem class="pb-4">
<template #prepend>
<VAvatar
size="38"
:image="team?.avatar"
class="me-2"
/>
</template>
<VCardTitle>{{ team.title }}</VCardTitle>
<template #append>
<div class="me-n3">
<IconBtn>
<VIcon
icon="ri-star-line"
color="disabled"
/>
</IconBtn>
<MoreBtn
item-props
:menu-list="moreList"
color="disabled"
/>
</div>
</template>
</VCardItem>
<VCardText>
<div class="text-base mb-4">
{{ team.description }}
</div>
<div class="d-flex">
<div class="v-avatar-group">
<VAvatar
v-for="data in team.avatarGroup"
:key="data.name"
size="32"
>
<VImg :src="data.avatar" />
<VTooltip
activator="parent"
location="top"
>
{{ data.name }}
</VTooltip>
</VAvatar>
<VAvatar
v-if="team.extraMembers"
:color="$vuetify.theme.current.dark ? '#3A3B59' : '#F0EFF0'"
:size="32"
>
<div class="text-body-2 text-high-emphasis font-weight-medium">
+{{ team.extraMembers }}
</div>
</VAvatar>
</div>
<VSpacer />
<div class="d-flex align-center gap-2">
<VChip
v-for="data in team.chips"
:key="data.title"
:color="data.color"
size="small"
>
{{ data.title }}
</VChip>
</div>
</div>
</VCardText>
</VCard>
</VCol>
</VRow>
</template>