App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <el-config-provider :size="globalComSize" :locale="zhCn">
  3. <router-view v-if="isRouterAlive"></router-view>
  4. </el-config-provider>
  5. </template>
  6. <script lang="ts" setup>
  7. import { computed, provide, nextTick } from 'vue'
  8. import { useSettingStore } from '@/store/modules/setting'
  9. // 配置element中文
  10. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  11. let isRouterAlive = true
  12. const SettingStore = useSettingStore()
  13. // 配置全局组件大小
  14. const globalComSize = computed((): string => SettingStore.themeConfig.globalComSize)
  15. const reload = () => {
  16. isRouterAlive = false
  17. nextTick(function () {
  18. isRouterAlive = true
  19. })
  20. }
  21. provide('reload', reload)
  22. </script>
  23. <style lang="scss">
  24. #app {
  25. position: relative;
  26. width: 100%;
  27. height: 100%;
  28. font-family: Avenir, sans-serif;
  29. -webkit-font-smoothing: antialiased;
  30. -moz-osx-font-smoothing: grayscale;
  31. color: #2c3e50;
  32. }
  33. .el-pager li:focus {
  34. border: none;
  35. }
  36. .el-dropdown:focus {
  37. border: none;
  38. }
  39. .svg-icon:focus {
  40. border: none;
  41. }
  42. </style>