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

@@ -15,7 +15,7 @@ import { mapTree } from '@vben-core/toolkit';
async function generateRoutesByBackend(
options: GeneratorMenuAndRoutesOptions,
): Promise<RouteRecordRaw[]> {
const { fetchMenuListAsync, layoutMap, pageMap } = options;
const { fetchMenuListAsync, layoutMap = {}, pageMap = {} } = options;
try {
const menuRoutes = await fetchMenuListAsync?.();

View File

@@ -46,7 +46,6 @@
"@vben-core/stores": "workspace:*",
"@vben-core/tabs-ui": "workspace:*",
"@vben-core/toolkit": "workspace:*",
"@vben/constants": "workspace:*",
"@vben/locales": "workspace:*",
"@vben/widgets": "workspace:*",
"vue": "^3.4.31",

View File

@@ -152,7 +152,6 @@ function toggleSidebar() {
<template #floating-groups>
<VbenBackTop />
<!-- <VbenFloatingButtonGroup /> -->
</template>
<!-- logo -->

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: {

View File

@@ -42,9 +42,7 @@
"dependencies": {
"@vben-core/design": "workspace:*",
"@vben-core/iconify": "workspace:*",
"@vben-core/preferences": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben/chart-ui": "workspace:*",
"@vben/locales": "workspace:*",
"@vben/types": "workspace:*",
"@vueuse/integrations": "^10.11.0",

View File

@@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/web.json",
"compilerOptions": {
"types": ["@vben/types/window"]
"types": ["@vben/types/global"]
},
"include": ["src"],
"exclude": ["node_modules"]

View File

@@ -46,11 +46,8 @@
"@vben-core/preferences": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben-core/toolkit": "workspace:*",
"@vben/chart-ui": "workspace:*",
"@vben/locales": "workspace:*",
"@vueuse/core": "^10.11.0",
"@vueuse/integrations": "^10.11.0",
"qrcode": "^1.5.3",
"vue": "^3.4.31",
"vue-router": "^4.4.0"
},

View File

@@ -37,12 +37,15 @@ const disableItem = computed(() => {
<SwitchItem v-model="breadcrumbHideOnlyOne" :disabled="disableItem">
{{ $t('preferences.breadcrumb.hide-only-one') }}
</SwitchItem>
<SwitchItem v-model="breadcrumbShowHome" :disabled="disableItem">
{{ $t('preferences.breadcrumb.home') }}
</SwitchItem>
<SwitchItem v-model="breadcrumbShowIcon" :disabled="disableItem">
{{ $t('preferences.breadcrumb.icon') }}
</SwitchItem>
<SwitchItem
v-model="breadcrumbShowHome"
:disabled="disableItem || !breadcrumbShowIcon"
>
{{ $t('preferences.breadcrumb.home') }}
</SwitchItem>
<ToggleItem
v-model="breadcrumbStyleType"
:disabled="disableItem"