Merge pull request #19 from vbenjs/feature/type-check-0705
fix: Typecheck and loop dependency problem repair
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const isMenuOpen = ref(false);
|
||||
const menuItems = ref(['1', '2', '3', '4']);
|
||||
|
||||
const toggleMenu = () => {
|
||||
isMenuOpen.value = !isMenuOpen.value;
|
||||
};
|
||||
|
||||
const handleMenuItemClick = (_item: any) => {
|
||||
// console.log(111, item);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="fixed bottom-5 right-5 flex flex-col-reverse items-center gap-2">
|
||||
<button
|
||||
:class="{ 'rotate-45': isMenuOpen }"
|
||||
class="flex h-12 w-12 items-center justify-center rounded-full bg-blue-500 text-xl text-white transition-transform duration-300"
|
||||
@click="toggleMenu"
|
||||
>
|
||||
✖
|
||||
</button>
|
||||
<div
|
||||
:class="{
|
||||
'visible translate-y-0 opacity-100': isMenuOpen,
|
||||
'invisible translate-y-2 opacity-0': !isMenuOpen,
|
||||
}"
|
||||
class="absolute bottom-16 right-0 flex flex-col-reverse gap-2 transition-all duration-300"
|
||||
>
|
||||
<button
|
||||
v-for="(item, index) in menuItems"
|
||||
:key="index"
|
||||
class="flex h-12 w-12 items-center justify-center rounded-full bg-blue-500 text-xl text-white"
|
||||
@click="handleMenuItemClick(item)"
|
||||
>
|
||||
{{ item }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* 可以在这里添加任何需要的额外样式 */
|
||||
</style>
|
@@ -1 +0,0 @@
|
||||
export { default as VbenFloatingButtonGroup } from './floating-button-group.vue';
|
@@ -8,7 +8,6 @@ export * from './checkbox';
|
||||
export * from './context-menu';
|
||||
export * from './count-to-animator';
|
||||
export * from './dropdown-menu';
|
||||
export * from './floating-button-group';
|
||||
export * from './full-screen';
|
||||
export * from './hover-card';
|
||||
export * from './icon';
|
||||
|
@@ -12,7 +12,8 @@ import {
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue';
|
||||
|
||||
import { SelectScrollDownButton, SelectScrollUpButton } from '.';
|
||||
import SelectScrollDownButton from './SelectScrollDownButton.vue';
|
||||
import SelectScrollUpButton from './SelectScrollUpButton.vue';
|
||||
|
||||
defineOptions({
|
||||
inheritAttrs: false,
|
||||
|
@@ -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?.();
|
||||
|
@@ -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",
|
||||
|
@@ -152,7 +152,6 @@ function toggleSidebar() {
|
||||
|
||||
<template #floating-groups>
|
||||
<VbenBackTop />
|
||||
<!-- <VbenFloatingButtonGroup /> -->
|
||||
</template>
|
||||
|
||||
<!-- logo -->
|
||||
|
@@ -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: {
|
||||
|
@@ -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",
|
||||
|
@@ -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"]
|
||||
|
@@ -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"
|
||||
},
|
||||
|
@@ -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"
|
||||
|
18
packages/types/global.d.ts
vendored
18
packages/types/global.d.ts
vendored
@@ -5,3 +5,21 @@ import 'vue-router';
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta extends IRouteMeta {}
|
||||
}
|
||||
|
||||
declare global {
|
||||
// interface Window {
|
||||
const __VBEN_ADMIN_METADATA__: {
|
||||
authorEmail: string;
|
||||
authorName: string;
|
||||
authorUrl: string;
|
||||
buildTime: string;
|
||||
dependencies: Record<string, string>;
|
||||
description: string;
|
||||
devDependencies: Record<string, string>;
|
||||
homepage: string;
|
||||
license: string;
|
||||
repositoryUrl: string;
|
||||
version: string;
|
||||
};
|
||||
// }
|
||||
}
|
||||
|
@@ -28,9 +28,6 @@
|
||||
},
|
||||
"./global": {
|
||||
"types": "./global.d.ts"
|
||||
},
|
||||
"./window": {
|
||||
"types": "./window.d.ts"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
|
19
packages/types/window.d.ts
vendored
19
packages/types/window.d.ts
vendored
@@ -1,19 +0,0 @@
|
||||
export {};
|
||||
|
||||
declare global {
|
||||
// interface Window {
|
||||
const __VBEN_ADMIN_METADATA__: {
|
||||
authorEmail: string;
|
||||
authorName: string;
|
||||
authorUrl: string;
|
||||
buildTime: string;
|
||||
dependencies: Record<string, string>;
|
||||
description: string;
|
||||
devDependencies: Record<string, string>;
|
||||
homepage: string;
|
||||
license: string;
|
||||
repositoryUrl: string;
|
||||
version: string;
|
||||
};
|
||||
// }
|
||||
}
|
Reference in New Issue
Block a user