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 193f5b65
authored
Jul 28, 2025
by
Jin Mao
Committed by
GitHub
Jul 28, 2025
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'main' into 2025072604
2 parents
06ffdf16
cb3f9668
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
packages/effects/layouts/src/basic/layout.vue
packages/effects/layouts/src/basic/layout.vue
View file @
193f5b6
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
type
{
SetupContext
}
from
'vue'
;
import
type
{
SetupContext
}
from
'vue'
;
import
type
{
RouteLocationNormalizedLoaded
}
from
'vue-router'
;
import
type
{
MenuRecordRaw
}
from
'@vben/types'
;
import
type
{
MenuRecordRaw
}
from
'@vben/types'
;
import
{
computed
,
useSlots
,
watch
}
from
'vue'
;
import
{
computed
,
onMounted
,
useSlots
,
watch
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRefresh
}
from
'@vben/hooks'
;
import
{
useRefresh
}
from
'@vben/hooks'
;
import
{
$t
,
i18n
}
from
'@vben/locales'
;
import
{
$t
,
i18n
}
from
'@vben/locales'
;
...
@@ -153,6 +155,23 @@ function clickLogo() {
...
@@ -153,6 +155,23 @@ function clickLogo() {
emit
(
'clickLogo'
);
emit
(
'clickLogo'
);
}
}
function
autoCollapseMenuByRouteMeta
(
route
:
RouteLocationNormalizedLoaded
)
{
// 只在双列模式下生效
if
(
preferences
.
app
.
layout
===
'sidebar-mixed-nav'
&&
route
.
meta
&&
route
.
meta
.
hideInMenu
)
{
sidebarExtraVisible
.
value
=
false
;
}
}
const
route
=
useRoute
();
onMounted
(()
=>
{
autoCollapseMenuByRouteMeta
(
route
);
});
watch
(
watch
(
()
=>
preferences
.
app
.
layout
,
()
=>
preferences
.
app
.
layout
,
async
(
val
)
=>
{
async
(
val
)
=>
{
...
...
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