fix: Typecheck and loop dependency problem repair

This commit is contained in:
vince
2024-07-05 11:12:38 +08:00
parent fa781633b5
commit 527023ae51
21 changed files with 462 additions and 750 deletions

View File

@@ -2,7 +2,7 @@ import type { IContextMenuItem } from '@vben-core/tabs-ui';
import type { TabItem } from '@vben-core/typings';
import type {
RouteLocationNormalized,
RouteRecordNormalized,
RouteLocationNormalizedGeneric,
} from 'vue-router';
import { computed, ref, watch } from 'vue';
@@ -34,8 +34,7 @@ function useTabs() {
});
const { locale } = useI18n();
const currentTabs =
ref<(RouteLocationNormalized | RouteRecordNormalized)[]>();
const currentTabs = ref<RouteLocationNormalizedGeneric[]>();
watch([() => tabsStore.getTabs, () => locale.value], ([tabs, _]) => {
currentTabs.value = tabs.map((item) => wrapperTabLocale(item));
});
@@ -60,9 +59,7 @@ function useTabs() {
await tabsStore.closeTabByKey(key, router);
};
function wrapperTabLocale(
tab: RouteLocationNormalized | RouteRecordNormalized,
) {
function wrapperTabLocale(tab: RouteLocationNormalizedGeneric) {
return {
...tab,
meta: {