chengxiangling
2025-05-16 af1c9e588f1de0240390648f9bb56aa486870aff
src/App.vue
@@ -1,8 +1,5 @@
<template>
  <el-config-provider :locale="locale === 'zh' ? zhCnEl : enUsEl">
    <keep-alive :include="cachedViewsList">
      <router-view />
    </keep-alive>
    <router-view />
  </el-config-provider>
</template>
@@ -14,21 +11,8 @@
import { useI18n } from "vue-i18n"; //要在js中使用国际化
const { locale } = useI18n();
import useSettingsStore from "@/store/modules/settings";
import useTagsViewStore from "@/store/modules/tagsView"
import { handleThemeStyle } from "@/utils/theme";
const route = useRoute();
const router = useRouter();
const cachedViewsList = ref([]);
const tagsViewStore = useTagsViewStore();
const cachedViews = function() {
  return router
    .getRoutes()
    .filter((r) => r.meta && r.meta.noCache)
    .map((r) => r.name);
};
onMounted(() => {
  cachedViewsList.value = tagsViewStore.cachedViews;
  console.log(cachedViewsList.value,"router.getRoutes()")
  nextTick(() => {
    // 初始化主题样式
    handleThemeStyle(useSettingsStore().theme);