settings.vue
1.56 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
<script setup lang="ts">
import type { NavigationMenuItem } from '@nuxt/ui'
const { t } = useAppI18n()
const { canAccessPage } = usePermission()
const links = computed<NavigationMenuItem[][]>(() => [[{
label: t('settings.nav.general'),
icon: 'i-lucide-user',
to: '/settings',
exact: true
}, {
label: t('settings.nav.members'),
icon: 'i-lucide-users',
to: '/settings/members'
}, {
label: t('settings.nav.notifications'),
icon: 'i-lucide-bell',
to: '/settings/notifications'
}, {
label: t('settings.nav.security'),
icon: 'i-lucide-shield',
to: '/settings/security'
}].filter((item) => {
return typeof item.to === 'string' ? canAccessPage(item.to) : true
}),
[
// {
// label: t('settings.nav.documentation'),
// icon: 'i-lucide-book-open',
// to: 'https://ui.nuxt.com/docs/getting-started/installation/nuxt',
// target: '_blank'
// }
]])
</script>
<template>
<UDashboardPanel id="settings" :ui="{ body: 'lg:py-12' }">
<template #header>
<UDashboardNavbar :title="t('settings.title')">
<template #leading>
<UDashboardSidebarCollapse />
</template>
</UDashboardNavbar>
<UDashboardToolbar>
<!-- NOTE: The `-mx-1` class is used to align with the `DashboardSidebarCollapse` button here. -->
<UNavigationMenu :items="links" highlight class="-mx-1 flex-1" />
</UDashboardToolbar>
</template>
<template #body>
<div class="flex flex-col gap-4 sm:gap-6 lg:gap-12 w-full lg:max-w-2xl mx-auto">
<NuxtPage />
</div>
</template>
</UDashboardPanel>
</template>