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 86ce65e0
authored
Feb 27, 2025
by
Netfan
Committed by
GitHub
Feb 27, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: hideChildrenInMenu demo code (#5626)
1 parent
c3eb4fab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
8 deletions
playground/src/router/routes/modules/demos.ts
playground/src/views/demos/features/hide-menu-children/children.vue
playground/src/views/demos/features/hide-menu-children/parent.vue
playground/src/router/routes/modules/demos.ts
View file @
86ce65e
...
@@ -147,8 +147,6 @@ const routes: RouteRecordRaw[] = [
...
@@ -147,8 +147,6 @@ const routes: RouteRecordRaw[] = [
{
{
name
:
'HideChildrenInMenuParentDemo'
,
name
:
'HideChildrenInMenuParentDemo'
,
path
:
'/demos/features/hide-menu-children'
,
path
:
'/demos/features/hide-menu-children'
,
component
:
()
=>
import
(
'#/views/demos/features/hide-menu-children/parent.vue'
),
meta
:
{
meta
:
{
hideChildrenInMenu
:
true
,
hideChildrenInMenu
:
true
,
icon
:
'ic:round-menu'
,
icon
:
'ic:round-menu'
,
...
@@ -160,10 +158,10 @@ const routes: RouteRecordRaw[] = [
...
@@ -160,10 +158,10 @@ const routes: RouteRecordRaw[] = [
path
:
''
,
path
:
''
,
component
:
()
=>
component
:
()
=>
import
(
import
(
'#/views/demos/features/hide-menu-children/
children
.vue'
'#/views/demos/features/hide-menu-children/
parent
.vue'
),
),
meta
:
{
meta
:
{
hideInMenu
:
true
,
//
hideInMenu: true,
title
:
$t
(
'demos.features.hideChildrenInMenu'
),
title
:
$t
(
'demos.features.hideChildrenInMenu'
),
},
},
},
},
...
@@ -174,7 +172,10 @@ const routes: RouteRecordRaw[] = [
...
@@ -174,7 +172,10 @@ const routes: RouteRecordRaw[] = [
import
(
import
(
'#/views/demos/features/hide-menu-children/children.vue'
'#/views/demos/features/hide-menu-children/children.vue'
),
),
meta
:
{
title
:
$t
(
'demos.features.hideChildrenInMenu'
)
},
meta
:
{
activePath
:
'/demos/features/hide-menu-children'
,
title
:
$t
(
'demos.features.hideChildrenInMenu'
),
},
},
},
],
],
},
},
...
...
playground/src/views/demos/features/hide-menu-children/children.vue
View file @
86ce65e
<
script
lang=
"ts"
setup
>
import
{
Fallback
,
VbenButton
}
from
'@vben/common-ui'
;
import
{
useTabs
}
from
'@vben/hooks'
;
import
{
X
}
from
'@vben/icons'
;
const
{
closeCurrentTab
}
=
useTabs
();
</
script
>
<
template
>
<
template
>
<div>
children
</div>
<Fallback
description=
"当前路由在菜单中不可见"
status=
"coming-soon"
title=
"被隐藏的子菜单"
show-back
>
<template
#
action
>
<VbenButton
size=
"lg"
@
click=
"closeCurrentTab()"
>
<X
class=
"mr-2 size-4"
/>
关闭当前标签页
</VbenButton>
</
template
>
</Fallback>
</template>
</template>
playground/src/views/demos/features/hide-menu-children/parent.vue
View file @
86ce65e
...
@@ -4,8 +4,14 @@ import { Fallback } from '@vben/common-ui';
...
@@ -4,8 +4,14 @@ import { Fallback } from '@vben/common-ui';
<
template
>
<
template
>
<Fallback
<Fallback
description=
"当前菜单的子菜单不可见
"
:description=
"`当前路由:$
{String($route.name)},子菜单不可见`
"
status="coming-soon"
status="coming-soon"
title="隐藏子菜单"
title="隐藏子菜单"
/>
>
<template
#
action
>
<RouterLink
to=
"/demos/features/hide-menu-children/children"
>
打开子路由
</RouterLink>
</
template
>
</Fallback>
</template>
</template>
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