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 9b73792d
authored
Dec 04, 2024
by
Netfan
Committed by
GitHub
Dec 04, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: extra menu title follow locale change (#5006)
1 parent
fccbe44c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
packages/effects/layouts/src/basic/layout.vue
packages/effects/layouts/src/basic/layout.vue
View file @
9b73792
...
...
@@ -110,10 +110,19 @@ const {
sidebarVisible
,
}
=
useMixedMenu
();
function
wrapperMenus
(
menus
:
MenuRecordRaw
[])
{
return
mapTree
(
menus
,
(
item
)
=>
{
return
{
...
cloneDeep
(
item
),
name
:
$t
(
item
.
name
)
};
});
/**
* 包装菜单,翻译菜单名称
* @param menus 原始菜单数据
* @param deep 是否深度包装。对于双列布局,只需要包装第一层,因为更深层的数据会在扩展菜单中重新包装
*/
function
wrapperMenus
(
menus
:
MenuRecordRaw
[],
deep
:
boolean
=
true
)
{
return
deep
?
mapTree
(
menus
,
(
item
)
=>
{
return
{
...
cloneDeep
(
item
),
name
:
$t
(
item
.
name
)
};
})
:
menus
.
map
((
item
)
=>
{
return
{
...
cloneDeep
(
item
),
name
:
$t
(
item
.
name
)
};
});
}
function
toggleSidebar
()
{
...
...
@@ -257,7 +266,7 @@ const headerSlots = computed(() => {
<
template
#
mixed-menu
>
<LayoutMixedMenu
:active-path=
"extraActiveMenu"
:menus=
"wrapperMenus(headerMenus)"
:menus=
"wrapperMenus(headerMenus
, false
)"
:rounded=
"isMenuRounded"
:theme=
"sidebarTheme"
@
default-select=
"handleDefaultSelect"
...
...
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