You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.6 KiB

1 year ago
<script lang="ts" setup>
import { isDark } from '@/utils/is'
import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import routerSearch from '@/components/RouterSearch/index.vue'
defineOptions({ name: 'APP' })
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('app')
const appStore = useAppStore()
const currentSize = computed(() => appStore.getCurrentSize)
const greyMode = computed(() => appStore.getGreyMode)
const { wsCache } = useCache()
// 根据浏览器当前主题设置系统主题色
const setDefaultTheme = () => {
// let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK)
let isDarkTheme = false
1 year ago
if (isDarkTheme === null) {
isDarkTheme = isDark()
}
appStore.setIsDark(isDarkTheme)
}
setDefaultTheme()
</script>
<template>
1 year ago
<ConfigGlobal :size="currentSize">
<RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" />
<routerSearch />
</ConfigGlobal>
</template>
1 year ago
<style lang="scss">
$prefix-cls: #{$namespace}-app;
1 year ago
.size {
width: 100%;
height: 100%;
}
html,
body {
@extend .size;
padding: 0 !important;
margin: 0;
overflow: hidden;
#app {
@extend .size;
}
1 year ago
}
.#{$prefix-cls}-grey-mode {
filter: grayscale(100%);
}
1 year ago
.el-select{
width: 100%;
}
1 year ago
/* 垂直滚动条样式 */
/* 宽度 */
::-webkit-scrollbar {
width: 12px;
}
/* 背景色 */
::-webkit-scrollbar-track {
background-color: #f5f5f5;
}
/* 滑块颜色 */
::-webkit-scrollbar-thumb {
background-color: #c1c1c1;
border-radius: 12px;
}
</style>