-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
37 lines (32 loc) · 828 Bytes
/
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
<script setup lang="ts">
import ConfirmPopup from 'primevue/confirmpopup'
import Toast from 'primevue/toast'
const config = useRuntimeConfig()
useHead({
titleTemplate: (titleChunk) => {
return titleChunk ? `${config.public.appName} - ${titleChunk}` : config.public.appName
},
})
const cookieRaw = useCookie('theme')
const route = useRoute()
const resolvedTheme = computed(() => {
let theme = 'tailwind-light'
if (route.query.theme)
theme = cookieRaw.value = route.query.theme as string
if (cookieRaw.value)
theme = cookieRaw.value
return `/themes/${theme}/theme.css`
})
</script>
<template>
<div class="h-full">
<Head>
<link rel="stylesheet" :href="resolvedTheme">
</Head>
<Toast />
<ConfirmPopup />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>