Commit 275ad9f14e8fa75620ff35c906c06c616fb2104f
1 parent
4c658f48
fix: fix the problem of closing multiple tabs
Showing
4 changed files
with
5 additions
and
11 deletions
CHANGELOG.zh_CN.md
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 | }); |