UserProfile.vue
3.33 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<script setup>
import { PerfectScrollbar } from 'vue3-perfect-scrollbar'
import avatar1 from '@images/avatars/avatar-1.png'
const userProfileList = [
{ type: 'divider' },
{
type: 'navItem',
icon: 'ri-user-line',
title: 'Profile',
value: 'profile',
},
{
type: 'navItem',
icon: 'ri-settings-4-line',
title: 'Settings',
value: 'settings',
},
{
type: 'navItem',
icon: 'ri-file-text-line',
title: 'Billing Plan',
value: 'billing',
badgeProps: {
color: 'error',
content: '4',
},
},
{ type: 'divider' },
{
type: 'navItem',
icon: 'ri-money-dollar-circle-line',
title: 'Pricing',
value: 'pricing',
},
{
type: 'navItem',
icon: 'ri-question-line',
title: 'FAQ',
value: 'faq',
},
{ type: 'divider' },
]
</script>
<template>
<VBadge
dot
bordered
location="bottom right"
offset-x="3"
offset-y="3"
color="success"
>
<VAvatar
class="cursor-pointer"
size="38"
>
<VImg :src="avatar1" />
<!-- SECTION Menu -->
<VMenu
activator="parent"
width="230"
location="bottom end"
offset="15px"
>
<VList>
<!-- 👉 User Avatar & Name -->
<VListItem>
<template #prepend>
<VListItemAction start>
<VBadge
dot
location="bottom right"
offset-x="3"
offset-y="3"
color="success"
>
<VAvatar
color="primary"
variant="tonal"
>
<VImg :src="avatar1" />
</VAvatar>
</VBadge>
</VListItemAction>
</template>
<h6 class="text-sm font-weight-medium">
John Doe
</h6>
<VListItemSubtitle class="text-capitalize text-disabled">
Admin
</VListItemSubtitle>
</VListItem>
<PerfectScrollbar :options="{ wheelPropagation: false }">
<template
v-for="item in userProfileList"
:key="item.title"
>
<VListItem
v-if="item.type === 'navItem'"
:value="item.value"
>
<template #prepend>
<VIcon
:icon="item.icon"
size="22"
/>
</template>
<VListItemTitle>{{ item.title }}</VListItemTitle>
<template
v-if="item.badgeProps"
#append
>
<VBadge
inline
v-bind="item.badgeProps"
/>
</template>
</VListItem>
<VDivider
v-else
class="my-1"
/>
</template>
<VListItem>
<VBtn
block
color="error"
append-icon="ri-logout-box-r-line"
to="/login"
>
Logout
</VBtn>
</VListItem>
</PerfectScrollbar>
</VList>
</VMenu>
<!-- !SECTION -->
</VAvatar>
</VBadge>
</template>