App.vue 458 B

12345678910111213141516171819202122
  1. <template>
  2. <router-view />
  3. </template>
  4. <script setup>
  5. import useSettingsStore from '@/store/modules/settings'
  6. import { handleThemeStyle } from '@/utils/theme'
  7. onMounted(() => {
  8. const lang = window.localStorage.getItem('lang');
  9. window.localStorage.setItem('lang', 'en');
  10. if(!lang) {
  11. // 刷新页面
  12. window.location.reload()
  13. }
  14. nextTick(() => {
  15. // 初始化主题样式
  16. handleThemeStyle(useSettingsStore().theme)
  17. })
  18. })
  19. </script>