app.vue
1.15 KB
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 ScrollToTop from '@core/components/ScrollToTop.vue'
import initCore from '@core/initCore'
import { initConfigStore, useConfigStore } from '@core/stores/config'
import { hexToRgb } from '@core/utils/colorConverter'
import { useTheme } from 'vuetify'
const { global } = useTheme()
// ℹ️ Sync current theme with initial loader theme
initCore()
initConfigStore()
const configStore = useConfigStore()
const { isMobile } = useDevice()
if (isMobile)
configStore.appContentLayoutNav = 'vertical'
onMounted(() => {
if (typeof window !== "undefined" && window.location.hash) {
const cleanUrl = window.location.origin + window.location.pathname;
window.history.replaceState(null, "", cleanUrl);
}
});
</script>
<template>
<VLocaleProvider :rtl="configStore.isAppRTL">
<!-- ℹ️ This is required to set the background color of active nav link based on currently active global theme's primary -->
<VApp :style="`--v-global-theme-primary: ${hexToRgb(global.current.value.colors.primary)}`">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
<ScrollToTop />
</VApp>
</VLocaleProvider>
</template>