forked from kuizuo/chaoxing-sign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
71 lines (63 loc) · 1.56 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
<script setup lang="ts">
import 'assets/css/preflight.css'
import { darkTheme, dateZhCN, lightTheme, zhCN } from 'naive-ui'
const colorMode = useColorMode()
const { title, keywords, description } = useAppConfig()
const theme = computed(() => {
return colorMode.value === 'system' ? (colorMode.value ? lightTheme : darkTheme) : colorMode.value === 'light' ? lightTheme : darkTheme
})
const themeColor = ref('#e70012')
const themeOverrides = computed(() => {
const theme = unref(themeColor)
const lightenStr = lighten(theme, 6)
return {
common: {
primaryColor: theme,
primaryColorHover: lightenStr,
primaryColorPressed: lightenStr,
primaryColorSuppl: theme,
},
}
})
useHead({
title,
link: [
{ rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' },
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
{
key: 'webmanifest',
rel: 'manifest',
href: '/manifest.webmanifest',
},
],
meta: [
{
name: 'keywords',
content: keywords,
},
{
name: 'description', content: description,
},
{
name: 'referrer', content: 'no-referrer',
},
],
})
</script>
<template>
<n-config-provider
:locale="zhCN" :date-locale="dateZhCN"
:theme="theme"
:theme-overrides="themeOverrides"
:inline-theme-disabled="true"
>
<n-global-style />
<VitePwaManifest />
<NuxtLoadingIndicator />
<n-message-provider keep-alive-on-hover>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</n-message-provider>
</n-config-provider>
</template>