| | |
| | | <template> |
| | | <el-config-provider :locale="locale === 'zh' ? zhCnEl : enUsEl"> |
| | | <!-- <keep-alive :include="cachedViewsList"> |
| | | <router-view /> |
| | | </keep-alive> --> |
| | | <router-view /> |
| | | </el-config-provider> |
| | | </template> |
| | |
| | | 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); |