2021-12-08 10:47:33 +08:00
|
|
|
<script setup lang="ts">
|
2022-01-03 09:41:34 +08:00
|
|
|
import { computed } from 'vue'
|
2021-12-31 17:19:53 +08:00
|
|
|
import { useAppStore } from '@/store/modules/app'
|
2022-01-03 09:41:34 +08:00
|
|
|
import { useLocaleStore } from '@/store/modules/locale'
|
2021-12-30 17:25:51 +08:00
|
|
|
import { ElConfigProvider } from 'element-plus'
|
2022-01-03 09:41:34 +08:00
|
|
|
import { ConfigGlobal } from '@/components/ConfigGlobal'
|
2021-12-31 17:19:53 +08:00
|
|
|
import { isDark } from '@/utils/is'
|
|
|
|
|
|
|
|
const appStore = useAppStore()
|
|
|
|
|
2022-01-03 09:41:34 +08:00
|
|
|
const localeStore = useLocaleStore()
|
|
|
|
|
|
|
|
const local = computed(() => localeStore.locale)
|
|
|
|
|
2021-12-31 17:19:53 +08:00
|
|
|
function initDark() {
|
|
|
|
const isDarkTheme = isDark()
|
|
|
|
appStore.setIsDark(isDarkTheme)
|
|
|
|
}
|
|
|
|
initDark()
|
2021-12-08 10:47:33 +08:00
|
|
|
</script>
|
|
|
|
|
2021-12-11 11:46:10 +08:00
|
|
|
<template>
|
2022-01-03 09:41:34 +08:00
|
|
|
<ConfigGlobal>
|
|
|
|
<ElConfigProvider :locale="local.elLocale">
|
2021-12-30 17:25:51 +08:00
|
|
|
<RouterView />
|
2021-12-30 16:03:02 +08:00
|
|
|
</ElConfigProvider>
|
2022-01-03 09:41:34 +08:00
|
|
|
</ConfigGlobal>
|
2021-12-11 11:46:10 +08:00
|
|
|
</template>
|
2021-12-31 17:19:53 +08:00
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
.size {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
html,
|
|
|
|
body {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
.size;
|
|
|
|
|
|
|
|
#app {
|
|
|
|
.size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|