Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 843ec1e7
authored
Aug 13, 2024
by
Netfan
Committed by
GitHub
Aug 13, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: tab close by key, fixed: #4132 (#4136)
1 parent
f20c5d9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
packages/stores/src/modules/tabbar.ts
packages/stores/src/modules/tabbar.ts
View file @
843ec1e
...
@@ -77,6 +77,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
...
@@ -77,6 +77,7 @@ export const useTabbarStore = defineStore('core-tabbar', {
/**
/**
* @zh_CN 跳转到标签页
* @zh_CN 跳转到标签页
* @param tab
* @param tab
* @param router
*/
*/
async
_goToTab
(
tab
:
TabDefinition
,
router
:
Router
)
{
async
_goToTab
(
tab
:
TabDefinition
,
router
:
Router
)
{
const
{
params
,
path
,
query
}
=
tab
;
const
{
params
,
path
,
query
}
=
tab
;
...
@@ -243,9 +244,13 @@ export const useTabbarStore = defineStore('core-tabbar', {
...
@@ -243,9 +244,13 @@ export const useTabbarStore = defineStore('core-tabbar', {
/**
/**
* @zh_CN 通过key关闭标签页
* @zh_CN 通过key关闭标签页
* @param key
* @param key
* @param router
*/
*/
async
closeTabByKey
(
key
:
string
,
router
:
Router
)
{
async
closeTabByKey
(
key
:
string
,
router
:
Router
)
{
const
index
=
this
.
tabs
.
findIndex
((
item
)
=>
getTabPath
(
item
)
===
key
);
const
originKey
=
decodeURIComponent
(
key
);
const
index
=
this
.
tabs
.
findIndex
(
(
item
)
=>
getTabPath
(
item
)
===
originKey
,
);
if
(
index
===
-
1
)
{
if
(
index
===
-
1
)
{
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment