-
-
Notifications
You must be signed in to change notification settings - Fork 980
/
Copy pathApp.vue
42 lines (33 loc) · 925 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
42
<script setup>
import { onBeforeMount } from 'vue'
import { useColorModes } from '@coreui/vue'
import { useThemeStore } from '@/stores/theme.js'
const { isColorModeSet, setColorMode } = useColorModes(
'coreui-free-vue-admin-template-theme',
)
const currentTheme = useThemeStore()
onBeforeMount(() => {
const urlParams = new URLSearchParams(window.location.href.split('?')[1])
let theme = urlParams.get('theme')
if (theme !== null && theme.match(/^[A-Za-z0-9\s]+/)) {
theme = theme.match(/^[A-Za-z0-9\s]+/)[0]
}
if (theme) {
setColorMode(theme)
return
}
if (isColorModeSet()) {
return
}
setColorMode(currentTheme.theme)
})
</script>
<template>
<router-view />
</template>
<style lang="scss">
// Import Main styles for this application
@use 'styles/style';
// We use those styles to show code examples, you should remove them in your application.
@use 'styles/examples';
</style>