From b3f74d8cff9d1f24be22371388b2bb89584320d9 Mon Sep 17 00:00:00 2001 From: yuntian001 Date: Wed, 21 Jun 2023 00:24:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=93=E6=9E=84stor?= =?UTF-8?q?e=E5=A4=B1=E5=8E=BB=E5=93=8D=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/header/components/tagBar/index.vue | 2 +- .../header/components/topBar/components/left.vue | 8 ++++---- .../header/components/topBar/components/right/index.vue | 2 +- src/layout/components/header/index.vue | 2 +- src/layout/index.vue | 2 +- src/views/login/components/header.vue | 2 +- types/auto-imports.d.ts | 2 ++ 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/layout/components/header/components/tagBar/index.vue b/src/layout/components/header/components/tagBar/index.vue index 7f5e4a69..903dfd4c 100644 --- a/src/layout/components/header/components/tagBar/index.vue +++ b/src/layout/components/header/components/tagBar/index.vue @@ -67,7 +67,7 @@ import contextmenu from './components/contextmenu.vue'; import { isExternal } from '@/utils/validate'; import { resolve } from 'path-browserify'; import $ from 'jquery'; -const { themeConfig } = useSettingStore(); +const { themeConfig } = storeToRefs(useSettingStore()); // 初始化tags const tags = reactive([] as RouteLocationNormalized[]); const resolvePath = (routePath: string, basePath = '') => { diff --git a/src/layout/components/header/components/topBar/components/left.vue b/src/layout/components/header/components/topBar/components/left.vue index 24d178eb..309139fb 100644 --- a/src/layout/components/header/components/topBar/components/left.vue +++ b/src/layout/components/header/components/topBar/components/left.vue @@ -24,17 +24,17 @@ import { mitter, event } from '@/event'; import { useSettingStore, useGlobalStore, useRouteStore } from '@/store'; import { RouteLocationNormalized, RouteRecordRaw } from 'vue-router'; -const { themeConfig } = useSettingStore(); +const { themeConfig } = storeToRefs(useSettingStore()); const globalStore = useGlobalStore(); const setMenuCollapse = () => { - themeConfig.menuCollapse = !themeConfig.menuCollapse; + themeConfig.value.menuCollapse = !themeConfig.value.menuCollapse; }; const breadcrumbList = ref([] as Pick[]); const route = useRoute(); -const { routes } = useRouteStore(); +const { routes } = storeToRefs(useRouteStore()); const setBreadcrumbList = (route: RouteLocationNormalized) => { const list = [] as Pick[]; - let temp = { children: routes } as unknown as RouteRecordRaw; + let temp = { children: routes.value } as unknown as RouteRecordRaw; route.meta.menuIndex!.forEach((item) => { temp = temp.children![item]; if (temp.meta && temp.meta.title && temp.meta.breadcrumb !== false) { diff --git a/src/layout/components/header/components/topBar/components/right/index.vue b/src/layout/components/header/components/topBar/components/right/index.vue index de305954..ef9dd88b 100644 --- a/src/layout/components/header/components/topBar/components/right/index.vue +++ b/src/layout/components/header/components/topBar/components/right/index.vue @@ -15,7 +15,7 @@ import { localeConfig } from '@/config'; import MessageBox from './components/messageBox.vue'; import { useSettingStore } from '@/store'; import User from './components/user.vue'; -const { themeConfig } = useSettingStore(); +const { themeConfig } = storeToRefs(useSettingStore());