Skip to content

Commit 275ad9f

Browse files
committed
fix: fix the problem of closing multiple tabs
1 parent 4c658f4 commit 275ad9f

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

CHANGELOG.zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- 修复 mock 分页工具错误
1414
- 修复表格开启搜索表单折叠问题
1515
- 修复表格 size 为 samll 时候,fixed 列样式问题
16+
- 修复多标签页关闭报错问题
1617

1718
## 2.0.0-rc.7 (2020-10-31)
1819

src/layouts/default/index.less

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@
312312
}
313313
}
314314

315-
&-lm {
316-
display: flex;
317-
}
318-
319315
&__logo {
320316
padding: 0 10px;
321317
}
@@ -333,7 +329,8 @@
333329
display: flex;
334330
align-items: center;
335331
height: @header-height;
336-
font-size: 1.1em;
332+
padding: 0 2px;
333+
font-size: 1.2em;
337334
cursor: pointer;
338335
}
339336

src/layouts/default/multitabs/useTabDropdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ export function closeTab(closedTab: TabItem | AppRouteRecordRaw) {
233233
const page = unref(getTabsState)[index - 1];
234234
const { params, path, query } = page;
235235
toObj = {
236-
params,
236+
params: params || {},
237237
path,
238-
query,
238+
query: query || {},
239239
};
240240
}
241241
const route = (unref(currentRoute) as unknown) as AppRouteRecordRaw;

src/utils/helper/routeHelper.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ export function genRouteModule(moduleList: AppRouteModule[]) {
2828
const flatList = (toRaw(router.getRoutes()).filter(
2929
(item) => item.children.length === 0
3030
) as unknown) as AppRouteRecordRaw[];
31-
try {
32-
(router as any) = null;
33-
} catch (error) {}
34-
3531
flatList.forEach((item) => {
3632
item.path = `${layout ? layout.path : ''}${item.path}`;
3733
});

0 commit comments

Comments
 (0)