yanjinhui
4 天以前 d3091b37a593885877f4ed4180d49e5ce259b657
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
43
44
45
46
47
48
49
50
<script setup lang="ts">
import { computed } from 'vue'
import { useAppStore } from '@/store/modules/app'
import { ConfigGlobal } from '@/components/ConfigGlobal'
import { useDesign } from '@/hooks/web/useDesign'
import { ElNotification } from 'element-plus'
 
const { getPrefixCls } = useDesign()
 
const prefixCls = getPrefixCls('app')
 
const appStore = useAppStore()
 
const currentSize = computed(() => appStore.getCurrentSize)
 
const greyMode = computed(() => appStore.getGreyMode)
 
appStore.initTheme()
</script>
 
<template>
  <ConfigGlobal :size="currentSize">
    <RouterView :class="greyMode ? `${prefixCls}-grey-mode` : ''" />
  </ConfigGlobal>
</template>
 
<style lang="less">
@prefix-cls: ~'@{adminNamespace}-app';
 
.size {
  width: 100%;
  height: 100%;
}
 
html,
body {
  padding: 0 !important;
  margin: 0;
  overflow: hidden;
  .size;
 
  #app {
    .size;
  }
}
 
.@{prefix-cls}-grey-mode {
  filter: grayscale(100%);
}
</style>