-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.vue
46 lines (40 loc) · 1.16 KB
/
app.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
<script setup lang="ts">
const mobileSidebarVisible = useState('mobile-sidebar-visible', () => false)
const activeView = useActiveView()
const sideMenuComponent = computed(() => {
switch (activeView.value) {
case 'settings':
return resolveComponent('SettingsSideMenu')
default:
return resolveComponent('SideMenu')
}
})
const viewComponent = computed(() => {
switch (activeView.value) {
case 'settings':
return resolveComponent('SettingsView')
case 'terminal':
return resolveComponent('TerminalView')
default:
return null
}
})
</script>
<template>
<div class="w-full min-h-dvh flex flex-col overflow-x-hidden">
<Sidebar />
<KeepAlive>
<component :is="sideMenuComponent" />
</KeepAlive>
<!-- sidebar overlay -->
<div v-if="mobileSidebarVisible" class="z-[19] w-screen h-dvh fixed inset-0 md:hidden" @click="mobileSidebarVisible = false" />
<div class="flex-1 min-h-dvh flex flex-col pl-0 md:pl-64 lg:pl-72">
<!-- main content -->
<KeepAlive>
<component :is="viewComponent" />
</KeepAlive>
</div>
<UNotifications />
<ConfirmationDialog />
</div>
</template>