gohttpdUi/src/App.vue

56 lines
1.0 KiB
Vue
Raw Normal View History

2021-12-08 10:47:33 +08:00
<script setup lang="ts">
import { computed } from 'vue'
2021-12-31 17:19:53 +08:00
import { useAppStore } from '@/store/modules/app'
import { ConfigGlobal } from '@/components/ConfigGlobal'
2021-12-31 17:19:53 +08:00
import { isDark } from '@/utils/is'
const appStore = useAppStore()
2022-01-18 16:22:47 +08:00
const currentSize = computed(() => appStore.getCurrentSize)
const greyMode = computed(() => appStore.getGreyMode)
const initDark = () => {
2021-12-31 17:19:53 +08:00
const isDarkTheme = isDark()
appStore.setIsDark(isDarkTheme)
}
2022-01-03 18:01:43 +08:00
2021-12-31 17:19:53 +08:00
initDark()
2021-12-08 10:47:33 +08:00
</script>
<template>
2022-01-18 16:22:47 +08:00
<ConfigGlobal :size="currentSize">
<RouterView :class="{ 'v-grey__mode': greyMode }" />
</ConfigGlobal>
</template>
2021-12-31 17:19:53 +08:00
<style lang="less">
2022-01-18 16:22:47 +08:00
@prefix-cls: ~'@{namespace}-grey';
2021-12-31 17:19:53 +08:00
.size {
width: 100%;
height: 100%;
}
html,
body {
2022-01-21 16:17:40 +08:00
padding: 0 !important;
2021-12-31 17:19:53 +08:00
margin: 0;
2022-01-13 17:26:06 +08:00
overflow: hidden;
2021-12-31 17:19:53 +08:00
.size;
#app {
.size;
}
}
2022-01-18 16:22:47 +08:00
.@{prefix-cls}__mode {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: progid:dximagetransform.microsoft.basicimage(grayscale=1);
}
2021-12-31 17:19:53 +08:00
</style>