App.vue 625 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div id="app">
  3. <router-view />
  4. </div>
  5. </template>
  6. <script setup>
  7. import { onMounted, nextTick } from 'vue'
  8. import useSettingsStore from '@/store/modules/settings'
  9. import { handleThemeStyle } from '@/utils/theme'
  10. onMounted(() => {
  11. nextTick(() => {
  12. // 初始化主题样式
  13. handleThemeStyle(useSettingsStore().theme)
  14. })
  15. })
  16. </script>
  17. <style>
  18. /* 必须添加的根容器样式,确保autofit.js正常工作 */
  19. html, body {
  20. width: 100%;
  21. height: 100%;
  22. margin: 0;
  23. padding: 0;
  24. overflow: hidden;
  25. }
  26. #app {
  27. width: 100%;
  28. height: 100%;
  29. overflow: hidden;
  30. position: relative;
  31. }
  32. </style>