Merge pull request #19 from vbenjs/feature/type-check-0705

fix: Typecheck and loop dependency problem repair
This commit is contained in:
vince292007
2024-07-05 11:14:57 +08:00
committed by GitHub
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: {