-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
37 lines (36 loc) · 1 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
<template>
<div class="mx-auto flex h-dvh w-dvw items-center justify-center">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
<!-- global Pop-up box start -->
<UNotifications />
<Settings />
<AuthAddAccount />
<LayoutLoadingFullScreen />
<!-- global Pop-up box end-->
<!-- analytics start -->
<SpeedInsights />
<!-- analytics end -->
</template>
<script setup lang="ts">
import { useCssVar } from '@vueuse/core';
import { rgbToHex } from '~/utils/color';
import { SpeedInsights } from '@vercel/speed-insights/vue';
const colorMode = useColorMode();
colorMode.preference = 'light';
// 初始化全局数据
const initGlobal = useInitGlobal();
initGlobal.init();
let defaultColor = '#517a7b';
const rgbIndex: number[] = useCssVar('--color-primary-DEFAULT')
.value?.split(' ')
.map((item) => Number(item));
if (rgbIndex && rgbIndex.length === 3) {
defaultColor = rgbToHex(rgbIndex[0], rgbIndex[1], rgbIndex[2]);
}
defineOgImageComponent('NuxtSeo', {
theme: defaultColor,
});
</script>