Commit 275ad9f14e8fa75620ff35c906c06c616fb2104f

Authored by vben
1 parent 4c658f48

fix: fix the problem of closing multiple tabs

CHANGELOG.zh_CN.md
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 - 修复 mock 分页工具错误 13 - 修复 mock 分页工具错误
14 - 修复表格开启搜索表单折叠问题 14 - 修复表格开启搜索表单折叠问题
15 - 修复表格 size 为 samll 时候,fixed 列样式问题 15 - 修复表格 size 为 samll 时候,fixed 列样式问题
  16 +- 修复多标签页关闭报错问题
16 17
17 ## 2.0.0-rc.7 (2020-10-31) 18 ## 2.0.0-rc.7 (2020-10-31)
18 19
src/layouts/default/index.less
@@ -312,10 +312,6 @@ @@ -312,10 +312,6 @@
312 } 312 }
313 } 313 }
314 314
315 - &-lm {  
316 - display: flex;  
317 - }  
318 -  
319 &__logo { 315 &__logo {
320 padding: 0 10px; 316 padding: 0 10px;
321 } 317 }
@@ -333,7 +329,8 @@ @@ -333,7 +329,8 @@
333 display: flex; 329 display: flex;
334 align-items: center; 330 align-items: center;
335 height: @header-height; 331 height: @header-height;
336 - font-size: 1.1em; 332 + padding: 0 2px;
  333 + font-size: 1.2em;
337 cursor: pointer; 334 cursor: pointer;
338 } 335 }
339 336
src/layouts/default/multitabs/useTabDropdown.ts
@@ -233,9 +233,9 @@ export function closeTab(closedTab: TabItem | AppRouteRecordRaw) { @@ -233,9 +233,9 @@ export function closeTab(closedTab: TabItem | AppRouteRecordRaw) {
233 const page = unref(getTabsState)[index - 1]; 233 const page = unref(getTabsState)[index - 1];
234 const { params, path, query } = page; 234 const { params, path, query } = page;
235 toObj = { 235 toObj = {
236 - params, 236 + params: params || {},
237 path, 237 path,
238 - query, 238 + query: query || {},
239 }; 239 };
240 } 240 }
241 const route = (unref(currentRoute) as unknown) as AppRouteRecordRaw; 241 const route = (unref(currentRoute) as unknown) as AppRouteRecordRaw;
src/utils/helper/routeHelper.ts
@@ -28,10 +28,6 @@ export function genRouteModule(moduleList: AppRouteModule[]) { @@ -28,10 +28,6 @@ export function genRouteModule(moduleList: AppRouteModule[]) {
28 const flatList = (toRaw(router.getRoutes()).filter( 28 const flatList = (toRaw(router.getRoutes()).filter(
29 (item) => item.children.length === 0 29 (item) => item.children.length === 0
30 ) as unknown) as AppRouteRecordRaw[]; 30 ) as unknown) as AppRouteRecordRaw[];
31 - try {  
32 - (router as any) = null;  
33 - } catch (error) {}  
34 -  
35 flatList.forEach((item) => { 31 flatList.forEach((item) => {
36 item.path = `${layout ? layout.path : ''}${item.path}`; 32 item.path = `${layout ? layout.path : ''}${item.path}`;
37 }); 33 });