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 a441dceb
authored
Aug 17, 2025
by
Elm1992
Committed by
Jin Mao
Aug 19, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: meta.link invalid issue
1 parent
ff4704d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
packages/effects/layouts/src/basic/menu/use-navigation.ts
packages/effects/layouts/src/basic/menu/use-navigation.ts
View file @
a441dce
...
@@ -29,7 +29,8 @@ function useNavigation() {
...
@@ -29,7 +29,8 @@ function useNavigation() {
return
true
;
return
true
;
}
}
const
route
=
routeMetaMap
.
get
(
path
);
const
route
=
routeMetaMap
.
get
(
path
);
return
route
?.
meta
?.
openInNewWindow
??
false
;
// 如果有外链或者设置了在新窗口打开,返回 true
return
!!
(
route
?.
meta
?.
link
||
route
?.
meta
?.
openInNewWindow
);
};
};
const
resolveHref
=
(
path
:
string
):
string
=>
{
const
resolveHref
=
(
path
:
string
):
string
=>
{
...
@@ -39,7 +40,13 @@ function useNavigation() {
...
@@ -39,7 +40,13 @@ function useNavigation() {
const
navigation
=
async
(
path
:
string
)
=>
{
const
navigation
=
async
(
path
:
string
)
=>
{
try
{
try
{
const
route
=
routeMetaMap
.
get
(
path
);
const
route
=
routeMetaMap
.
get
(
path
);
const
{
openInNewWindow
=
false
,
query
=
{}
}
=
route
?.
meta
??
{};
const
{
openInNewWindow
=
false
,
query
=
{},
link
}
=
route
?.
meta
??
{};
// 检查是否有外链
if
(
link
&&
typeof
link
===
'string'
)
{
openWindow
(
link
,
{
target
:
'_blank'
});
return
;
}
if
(
isHttpUrl
(
path
))
{
if
(
isHttpUrl
(
path
))
{
openWindow
(
path
,
{
target
:
'_blank'
});
openWindow
(
path
,
{
target
:
'_blank'
});
...
...
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