-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
41 lines (36 loc) · 973 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
38
39
40
41
<script setup lang="ts">
import {
arDZ,
dateArDZ,
dateEnUS,
enUS,
NConfigProvider,
NThemeEditor,
} from 'naive-ui';
import themeConfig, { _lightThemeVars } from './_theme.config';
import useI18nHandler from '~/composables/core/useI18nHandler';
import useNThemeHandler from '~/composables/core/useNThemeHandler';
const { set_lang, lang_cookie } = useI18nHandler();
const { theme_overrides } = useNThemeHandler();
set_lang(lang_cookie.value);
const is_dev_env = computed(() => process.env.NODE_ENV === 'development');
useHead({
htmlAttrs: {
style: themeConfig(_lightThemeVars),
},
});
</script>
<template>
<n-config-provider
:date-locale="lang_cookie === 'en' ? dateEnUS : dateArDZ"
:locale="lang_cookie === 'en' ? enUS : arDZ"
:theme-overrides="theme_overrides"
>
<client-only v-if="is_dev_env">
<n-theme-editor />
</client-only>
<nuxtLayout>
<NuxtPage />
</nuxtLayout>
</n-config-provider>
</template>