DemoListSubGroup.vue
1.43 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
<script lang="ts" setup>
const open = ref(['Users', 'Admin'])
const admins = [
['Management', 'ri-group-line'],
['Settings', 'ri-settings-5-line'],
]
const cruds = [
['Create', 'ri-add-line'],
['Read', 'ri-file-line'],
['Update', 'ri-refresh-line'],
['Delete', 'ri-delete-bin-line'],
]
</script>
<template>
<VList v-model:opened="open">
<VListItem
prepend-icon="ri-home-line"
title="Home"
value="Home"
/>
<VListGroup value="Users">
<template #activator="{ props }">
<VListItem
v-bind="props"
prepend-icon="ri-user-line"
title="Users"
/>
</template>
<VListGroup value="Admin">
<template #activator="{ props }">
<VListItem
v-bind="props"
title="Admin"
/>
</template>
<VListItem
v-for="([title, icon], i) in admins"
:key="i"
:value="title"
:title="title"
:prepend-icon="icon"
/>
</VListGroup>
<VListGroup value="Actions">
<template #activator="{ props }">
<VListItem
v-bind="props"
title="Actions"
/>
</template>
<VListItem
v-for="([title, icon], i) in cruds"
:key="i"
:value="title"
:title="title"
:prepend-icon="icon"
/>
</VListGroup>
</VListGroup>
</VList>
</template>