From c2c32332d3df3856b56432ba529cd84cfbe33bd8 Mon Sep 17 00:00:00 2001 From: vince Date: Tue, 16 Jul 2024 22:07:28 +0800 Subject: [PATCH] fix: shake when adding tabs --- .../src/router/routes/modules/demos.ts | 30 +- .../lint-configs/eslint-config/package.json | 4 +- internal/tailwind-config/package.json | 4 +- internal/tsconfig/package.json | 2 +- internal/vite-config/package.json | 2 +- internal/vite-config/src/utils/env.ts | 2 +- package.json | 4 +- packages/@core/shared/constants/src/global.ts | 12 - .../@core/shared/constants/src/globals.ts | 10 + packages/@core/shared/constants/src/index.ts | 2 +- .../src/components/layout-tabbar.vue | 2 +- .../ui-kit/layout-ui/src/vben-layout.vue | 17 +- .../src/components/tabs-chrome/tabs.vue | 34 +- .../tabs-ui/src/components/tabs/tabs.vue | 2 +- .../common-ui/src/fallback/fallback.vue | 4 +- pnpm-lock.yaml | 351 +++++++++++------- 16 files changed, 256 insertions(+), 226 deletions(-) delete mode 100644 packages/@core/shared/constants/src/global.ts create mode 100644 packages/@core/shared/constants/src/globals.ts diff --git a/apps/web-antd/src/router/routes/modules/demos.ts b/apps/web-antd/src/router/routes/modules/demos.ts index a130c51e..b8c04489 100644 --- a/apps/web-antd/src/router/routes/modules/demos.ts +++ b/apps/web-antd/src/router/routes/modules/demos.ts @@ -22,8 +22,8 @@ const routes: RouteRecordRaw[] = [ title: $t('page.demos.access.frontendPermissions'), }, name: 'Access', - path: '/access', - redirect: '/access/page-control', + path: 'access', + redirect: '/demos/access/page-control', children: [ { name: 'AccessPageControl', @@ -93,8 +93,8 @@ const routes: RouteRecordRaw[] = [ title: $t('page.demos.features.title'), }, name: 'Features', - path: '/features', - redirect: '/features/hide-menu-children', + path: 'features', + redirect: '/demos/features/hide-menu-children', children: [ { name: 'HideChildrenInMenuParent', @@ -135,8 +135,8 @@ const routes: RouteRecordRaw[] = [ title: $t('page.demos.fallback.title'), }, name: 'Fallback', - path: '/fallback', - redirect: '/fallback/403', + path: 'fallback', + redirect: '/demos/fallback/403', children: [ { name: 'Fallback403', @@ -183,8 +183,8 @@ const routes: RouteRecordRaw[] = [ title: $t('page.demos.outside.title'), }, name: 'Outside', - path: '/outside', - redirect: '/outside/iframe', + path: 'outside', + redirect: '/demos/outside/iframe', children: [ { name: 'iframe', @@ -193,7 +193,7 @@ const routes: RouteRecordRaw[] = [ icon: 'mdi:newspaper-variant-outline', title: $t('page.demos.outside.embedded'), }, - redirect: '/outside/iframe/vue-document', + redirect: '/demos/outside/iframe/vue-document', children: [ { name: 'VueDocument', @@ -226,7 +226,7 @@ const routes: RouteRecordRaw[] = [ icon: 'mdi:newspaper-variant-multiple-outline', title: $t('page.demos.outside.externalLink'), }, - redirect: '/outside/external-link/vite', + redirect: '/demos/outside/external-link/vite', children: [ { name: 'Vite', @@ -258,8 +258,8 @@ const routes: RouteRecordRaw[] = [ title: $t('page.demos.nested.title'), }, name: 'Nested', - path: '/nested', - redirect: '/nested/menu1', + path: 'nested', + redirect: '/demos/nested/menu1', children: [ { name: 'Menu1', @@ -279,7 +279,7 @@ const routes: RouteRecordRaw[] = [ keepAlive: true, title: $t('page.demos.nested.menu2'), }, - redirect: '/nested/menu2/menu2-1', + redirect: '/demos/nested/menu2/menu2-1', children: [ { name: 'Menu21', @@ -300,7 +300,7 @@ const routes: RouteRecordRaw[] = [ icon: 'ic:round-menu', title: $t('page.demos.nested.menu3'), }, - redirect: '/nested/menu3/menu3-1', + redirect: '/demos/nested/menu3/menu3-1', children: [ { name: 'Menu31', @@ -319,7 +319,7 @@ const routes: RouteRecordRaw[] = [ icon: 'ic:round-menu', title: $t('page.demos.nested.menu3_2'), }, - redirect: '/nested/menu3/menu3-2/menu3-2-1', + redirect: '/demos/nested/menu3/menu3-2/menu3-2-1', children: [ { name: 'Menu321', diff --git a/internal/lint-configs/eslint-config/package.json b/internal/lint-configs/eslint-config/package.json index 4bd95805..47a4fb95 100644 --- a/internal/lint-configs/eslint-config/package.json +++ b/internal/lint-configs/eslint-config/package.json @@ -33,8 +33,8 @@ "devDependencies": { "@eslint/js": "^9.7.0", "@types/eslint": "^8.56.10", - "@typescript-eslint/eslint-plugin": "^7.16.0", - "@typescript-eslint/parser": "^7.16.0", + "@typescript-eslint/eslint-plugin": "^7.16.1", + "@typescript-eslint/parser": "^7.16.1", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-eslint-comments": "^3.2.0", diff --git a/internal/tailwind-config/package.json b/internal/tailwind-config/package.json index cb6fc8f2..bab95eb0 100644 --- a/internal/tailwind-config/package.json +++ b/internal/tailwind-config/package.json @@ -47,7 +47,7 @@ "tailwindcss": "^3.4.3" }, "dependencies": { - "@iconify/json": "^2.2.227", + "@iconify/json": "^2.2.228", "@iconify/tailwind": "^1.1.1", "@tailwindcss/forms": "^0.5.7", "@tailwindcss/nesting": "0.0.0-insiders.565cd3e", @@ -58,7 +58,7 @@ "postcss-antd-fixes": "^0.2.0", "postcss-import": "^16.1.0", "postcss-preset-env": "^9.6.0", - "tailwindcss": "^3.4.4", + "tailwindcss": "^3.4.5", "tailwindcss-animate": "^1.0.7" }, "devDependencies": { diff --git a/internal/tsconfig/package.json b/internal/tsconfig/package.json index 39264fb3..40c423fc 100644 --- a/internal/tsconfig/package.json +++ b/internal/tsconfig/package.json @@ -20,6 +20,6 @@ ], "dependencies": { "@vben/types": "workspace:*", - "vite": "^5.3.3" + "vite": "^5.3.4" } } diff --git a/internal/vite-config/package.json b/internal/vite-config/package.json index 24a925c0..88bc8242 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -46,7 +46,7 @@ "rollup": "^4.18.1", "rollup-plugin-visualizer": "^5.12.0", "sass": "^1.77.8", - "vite": "^5.3.3", + "vite": "^5.3.4", "vite-plugin-compression": "^0.5.1", "vite-plugin-dts": "^3.9.1", "vite-plugin-html": "^3.2.2" diff --git a/internal/vite-config/src/utils/env.ts b/internal/vite-config/src/utils/env.ts index a8bd0589..41b1a0ac 100644 --- a/internal/vite-config/src/utils/env.ts +++ b/internal/vite-config/src/utils/env.ts @@ -63,7 +63,7 @@ async function loadAndConvertEnv( const compress = envConfig.VITE_COMPRESS || ''; const compressTypes = compress .split(',') - .filter((item) => ['brotli', 'gzip'].includes(item)); + .filter((item) => item === 'brotli' || item === 'gzip'); return { appTitle: envConfig?.VITE_GLOB_APP_TITLE ?? 'Vben Admin', compress: !!compress, diff --git a/package.json b/package.json index 1c9222cd..70f0f417 100644 --- a/package.json +++ b/package.json @@ -73,8 +73,8 @@ "turbo": "^2.0.6", "typescript": "^5.5.3", "unbuild": "^2.0.0", - "vite": "^5.3.3", - "vitest": "^2.0.2", + "vite": "^5.3.4", + "vitest": "^2.0.3", "vue-tsc": "^2.0.26" }, "engines": { diff --git a/packages/@core/shared/constants/src/global.ts b/packages/@core/shared/constants/src/global.ts deleted file mode 100644 index e2d5ba93..00000000 --- a/packages/@core/shared/constants/src/global.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @zh_CN 布局内容高度 css变量 - * @en_US Layout content height - */ -const CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT = `--vben-content-height`; - -/** - * @zh_CN 默认命名空间 - */ -const DEFAULT_NAMESPACE = 'vben'; - -export { CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT, DEFAULT_NAMESPACE }; diff --git a/packages/@core/shared/constants/src/globals.ts b/packages/@core/shared/constants/src/globals.ts new file mode 100644 index 00000000..0da08ba2 --- /dev/null +++ b/packages/@core/shared/constants/src/globals.ts @@ -0,0 +1,10 @@ +/** + * @zh_CN 布局内容高度 css变量 + * @en_US Layout content height + */ +export const CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT = `--vben-content-height`; + +/** + * @zh_CN 默认命名空间 + */ +export const DEFAULT_NAMESPACE = 'vben'; diff --git a/packages/@core/shared/constants/src/index.ts b/packages/@core/shared/constants/src/index.ts index 976def69..09e55f5b 100644 --- a/packages/@core/shared/constants/src/index.ts +++ b/packages/@core/shared/constants/src/index.ts @@ -1,2 +1,2 @@ -export * from './global'; +export * from './globals'; export * from './vben'; diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue index 83883aa2..e741f8d3 100644 --- a/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue +++ b/packages/@core/ui-kit/layout-ui/src/components/layout-tabbar.vue @@ -26,7 +26,7 @@ const style = computed((): CSSProperties => {