From b92b8a3c6af1d936d48b5f58674f419407eeb600 Mon Sep 17 00:00:00 2001 From: Vben Date: Mon, 19 Apr 2021 23:40:59 +0800 Subject: [PATCH] fix(tabs): fix the problem that other functions are invalid when the tab is closed, close #376 --- CHANGELOG.zh_CN.md | 1 + build/vite/plugin/hmr.ts | 2 ++ build/vite/plugin/index.ts | 4 ++-- package.json | 4 ++-- src/components/ContextMenu/src/index.less | 5 +++++ src/components/ContextMenu/src/index.tsx | 6 +++++- src/store/modules/multipleTab.ts | 2 +- src/views/sys/about/index.vue | 2 +- yarn.lock | 18 +++++++++--------- 9 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index b73a57c7..716a25e6 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -13,6 +13,7 @@ ### 🐛 Bug Fixes - 修复黑暗主题刷新闪烁的白屏 +- 修复标签页关闭其他功能失效问题 ## 2.3.0 (2021-04-10) diff --git a/build/vite/plugin/hmr.ts b/build/vite/plugin/hmr.ts index cb84e264..58310628 100644 --- a/build/vite/plugin/hmr.ts +++ b/build/vite/plugin/hmr.ts @@ -11,10 +11,12 @@ export function configHmrPlugin(): Plugin { name: 'singleHMR', handleHotUpdate({ modules, file }) { if (file.match(/xml$/)) return []; + modules.forEach((m) => { m.importedModules = new Set(); m.importers = new Set(); }); + return modules; }, }; diff --git a/build/vite/plugin/index.ts b/build/vite/plugin/index.ts index 286b07a3..498278e8 100644 --- a/build/vite/plugin/index.ts +++ b/build/vite/plugin/index.ts @@ -16,7 +16,7 @@ import { configThemePlugin } from './theme'; import { configImageminPlugin } from './imagemin'; import { configWindiCssPlugin } from './windicss'; import { configSvgIconsPlugin } from './svgSprite'; -import { configHmrPlugin } from './hmr'; +// import { configHmrPlugin } from './hmr'; export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { const { @@ -35,7 +35,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { ]; // TODO - !isBuild && vitePlugins.push(configHmrPlugin()); + // !isBuild && vitePlugins.push(configHmrPlugin()); // @vitejs/plugin-legacy VITE_LEGACY && isBuild && vitePlugins.push(legacy()); diff --git a/package.json b/package.json index cba7c741..128e0232 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ }, "dependencies": { "@iconify/iconify": "^2.0.0-rc.6", - "@logicflow/core": "^0.3.0", - "@logicflow/extension": "^0.3.0", + "@logicflow/core": "^0.3.1", + "@logicflow/extension": "^0.3.1", "@vueuse/core": "^4.8.2", "@zxcvbn-ts/core": "^0.3.0", "ant-design-vue": "^2.1.2", diff --git a/src/components/ContextMenu/src/index.less b/src/components/ContextMenu/src/index.less index 76385474..3d8dec03 100644 --- a/src/components/ContextMenu/src/index.less +++ b/src/components/ContextMenu/src/index.less @@ -57,4 +57,9 @@ .item-style(); } + + .ant-menu-submenu-title, + .ant-menu-item { + padding: 0 !important; + } } diff --git a/src/components/ContextMenu/src/index.tsx b/src/components/ContextMenu/src/index.tsx index 05b978c8..05d5df58 100644 --- a/src/components/ContextMenu/src/index.tsx +++ b/src/components/ContextMenu/src/index.tsx @@ -15,7 +15,11 @@ const prefixCls = 'context-menu'; const ItemContent: FunctionalComponent = (props) => { const { item } = props; return ( - + {props.showIcon && item.icon && } {item.label} diff --git a/src/store/modules/multipleTab.ts b/src/store/modules/multipleTab.ts index bb7dac5f..450dee41 100644 --- a/src/store/modules/multipleTab.ts +++ b/src/store/modules/multipleTab.ts @@ -267,7 +267,7 @@ export const useMultipleTabStore = defineStore({ if (path !== route.fullPath) { const closeItem = this.tabList.find((item) => item.path === path); if (!closeItem) { - return; + continue; } const affix = closeItem?.meta?.affix ?? false; if (!affix) { diff --git a/src/views/sys/about/index.vue b/src/views/sys/about/index.vue index 40318526..90468285 100644 --- a/src/views/sys/about/index.vue +++ b/src/views/sys/about/index.vue @@ -4,7 +4,7 @@
{{ name }} - 是一个基于Vue3.0、Vite、 Ant-Design-Vue 、TypeScript + 是一个基于Vue3.01、Vite、 Ant-Design-Vue 、TypeScript 的后台解决方案,目标是为中大型项目开发,提供现成的开箱解决方案及丰富的示例,原则上不会限制任何代码用于商用。
diff --git a/yarn.lock b/yarn.lock index edeb1c27..c1212355 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1151,17 +1151,17 @@ resolved "https://registry.npmjs.org/@intlify/shared/-/shared-9.0.0.tgz#d85b3b5f9033f377c5cf2202cf2459aa49948f36" integrity sha512-0r4v7dnY8g/Jfx2swUWy2GyfH/WvIpWvkU4OIupvxDTWiE8RhcpbOCVvqpVh/xGi0proHQ/r2Dhc0QSItUsfDQ== -"@logicflow/core@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@logicflow/core/-/core-0.3.0.tgz#910ca7865487fbe6c45a450d13627875c6965bf4" - integrity sha512-FPRTuj0y6Yny+YDZ+faTzA8pZyouEWX1Vr6rH91wJR0J3NOHgb7pV/TJoHSosavFuyyw87nLw9UsyUUgHKVV+A== +"@logicflow/core@^0.3.1": + version "0.3.1" + resolved "https://registry.npmjs.org/@logicflow/core/-/core-0.3.1.tgz#183402506c3113f391fb5415d3b3de9093fa843b" + integrity sha512-PZwwaRGURwOWFf4JVDc6GGfDRZtawvVGY6/3Z4cjulNiEFzxtQnz4RH0Zqzd6qFRxpEctqKnZ+eckLPWX4YFug== -"@logicflow/extension@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@logicflow/extension/-/extension-0.3.0.tgz#cea4470de3a8e4b7da69b17d7507b2d8edd76b50" - integrity sha512-vMmYT8H53oFhOpNftCYQMbNYbTiXqQUxOOKlPcrKkZb0FsXSiEZ/MUKBF3mAarvFlzdMaB5xJjakMfy07/bdvw== +"@logicflow/extension@^0.3.1": + version "0.3.1" + resolved "https://registry.npmjs.org/@logicflow/extension/-/extension-0.3.1.tgz#984ced98df97a3460ee43ac9a513c20511ebe862" + integrity sha512-WSPVqwmTvI52e2Go6EQeUEoHs+l6o2h4u47iVuwC39A/cIFcc2skefQ9fTzGJHeWIXjPf7Nl/W5ylrmeVsIJ4Q== dependencies: - "@logicflow/core" "^0.3.0" + "@logicflow/core" "^0.3.1" ids "^1.0.0" "@nodelib/fs.scandir@2.1.4": -- GitLab