-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
Copy pathApp.vue
78 lines (65 loc) · 1.65 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
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
<script lang="ts" setup>
import { useHead } from '@unhead/vue'
import { useAppStore } from 'valaxy'
import { onMounted, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useThemeConfig } from './composables'
import { useYunAppStore } from './stores'
const appStore = useAppStore()
useHead({
link: [
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@900&display=swap',
},
],
meta: [
{
name: 'theme-color',
content: appStore.themeColor,
},
{
name: 'msapplication-TileColor',
content: appStore.themeColor,
},
],
})
const themeConfig = useThemeConfig()
const app = useAppStore()
const yun = useYunAppStore()
const route = useRoute()
watch(
() => route.meta.layout,
() => {
if (route.meta.layout === 'home' || app.isMobile)
yun.leftSidebar.isOpen = false
else
yun.leftSidebar.isOpen = false
},
{ immediate: true },
)
onMounted(() => {
// for mobile vh
document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`)
app.showLoading = false
})
const isDev = import.meta.env.DEV
</script>
<template>
<YunStratoApp v-if="yun.isStrato" />
<YunDebug v-if="isDev" />
<YunPageHeaderGradient />
<YunNavMenu />
<YunFullscreenMenu v-if="yun.isNimbo && !yun.size.isLg" />
<YunStratoSidebar v-if="yun.isStrato" />
<YunFireworks v-if="themeConfig.fireworks.enable" />
<slot name="bg">
<YunBg v-if="themeConfig.bg_image.enable" />
</slot>
<Transition name="fade">
<YunLoading v-if="app.showLoading" />
</Transition>
<YunBackToTop />
<!-- TODO -->
<!-- <YunDock /> -->
</template>