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 4dbd13d4
authored
Jul 06, 2024
by
Li Kui
Committed by
GitHub
Jul 06, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: pin tab not working correct (#23)
1 parent
a60467b0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
packages/@core/forward/stores/src/modules/tabbar.ts
packages/@core/forward/stores/src/modules/tabbar.ts
View file @
4dbd13d
...
@@ -143,6 +143,7 @@ const useCoreTabbarStore = defineStore('core-tabbar', {
...
@@ -143,6 +143,7 @@ const useCoreTabbarStore = defineStore('core-tabbar', {
currentTab
.
params
=
params
||
currentTab
.
params
;
currentTab
.
params
=
params
||
currentTab
.
params
;
currentTab
.
query
=
query
||
currentTab
.
query
;
currentTab
.
query
=
query
||
currentTab
.
query
;
currentTab
.
fullPath
=
fullPath
||
currentTab
.
fullPath
;
currentTab
.
fullPath
=
fullPath
||
currentTab
.
fullPath
;
currentTab
.
meta
=
meta
||
currentTab
.
meta
;
this
.
tabs
.
splice
(
tabIndex
,
1
,
currentTab
);
this
.
tabs
.
splice
(
tabIndex
,
1
,
currentTab
);
}
}
this
.
updateCacheTab
();
this
.
updateCacheTab
();
...
@@ -285,7 +286,13 @@ const useCoreTabbarStore = defineStore('core-tabbar', {
...
@@ -285,7 +286,13 @@ const useCoreTabbarStore = defineStore('core-tabbar', {
this
.
tabs
[
index
].
meta
.
affixTab
=
true
;
this
.
tabs
[
index
].
meta
.
affixTab
=
true
;
}
}
// TODO: 这里应该把tab从tbs中移除
// TODO: 这里应该把tab从tbs中移除
const
affixIndex
=
this
.
affixTabs
.
findIndex
(
(
item
)
=>
this
.
getTabPath
(
item
)
===
this
.
getTabPath
(
tab
),
);
if
(
affixIndex
===
-
1
)
{
tab
.
meta
.
affixTab
=
true
;
this
.
affixTabs
.
push
(
tab
as
unknown
as
RouteRecordNormalized
);
this
.
affixTabs
.
push
(
tab
as
unknown
as
RouteRecordNormalized
);
}
},
},
/**
/**
* 刷新标签页
* 刷新标签页
...
@@ -324,6 +331,7 @@ const useCoreTabbarStore = defineStore('core-tabbar', {
...
@@ -324,6 +331,7 @@ const useCoreTabbarStore = defineStore('core-tabbar', {
);
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
tab
.
meta
.
affixTab
=
false
;
this
.
affixTabs
[
index
].
meta
.
affixTab
=
false
;
this
.
affixTabs
[
index
].
meta
.
affixTab
=
false
;
this
.
affixTabs
.
splice
(
index
,
1
);
this
.
affixTabs
.
splice
(
index
,
1
);
this
.
addTab
(
tab
);
this
.
addTab
(
tab
);
...
...
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