Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
1323310e
Commit
1323310e
authored
Aug 12, 2021
by
Zhang Xiaojie
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
668b1aaa
b0a3732f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
index.ts
src/router/index.ts
+6
-0
index.vue
src/views/Root/index.vue
+5
-2
types.ts
src/views/Root/types.ts
+2
-0
No files found.
src/router/index.ts
View file @
1323310e
...
...
@@ -24,6 +24,9 @@ const routes: Array<RouteConfig> = [
component
:
item
.
component
,
meta
:
{
roles
:
item
.
roles
,
selectedName
:
item
.
belongToMenuName
?
item
.
belongToMenuName
:
item
.
routeName
,
},
children
:
((
item
.
getChildren
&&
item
.
getChildren
())
||
[]).
map
(
(
subItem
)
=>
{
...
...
@@ -33,6 +36,9 @@ const routes: Array<RouteConfig> = [
component
:
subItem
.
component
,
meta
:
{
roles
:
subItem
.
roles
,
selectedName
:
item
.
belongToMenuName
?
item
.
belongToMenuName
:
item
.
routeName
,
},
}
},
...
...
src/views/Root/index.vue
View file @
1323310e
...
...
@@ -10,7 +10,7 @@
:selectedKeys=
"selectedKeys"
>
<component
v-for=
"menu in
m
enuList"
v-for=
"menu in
filteredM
enuList"
:key=
"menu.routeName"
@
click=
"handleClickMenu"
:is=
"hasChildren(menu) ? 'a-sub-menu' : 'a-menu-item'"
...
...
@@ -78,8 +78,11 @@ export default Vue.extend({
menuList
():
iMenuList
{
return
getMenuList
(
this
.
role
);
},
filteredMenuList
():
iMenuList
{
return
this
.
menuList
.
filter
((
i
)
=>
!
i
.
hiddeInMenu
);
},
selectedKeys
()
{
return
[
this
.
$route
.
n
ame
];
return
[
(
this
.
$route
.
meta
as
{
selectedName
:
string
}).
selectedN
ame
];
},
},
methods
:
{
...
...
src/views/Root/types.ts
View file @
1323310e
...
...
@@ -6,6 +6,8 @@ export interface iMenuConfigItem {
getName
:
(
role
:
eRole
)
=>
string
getChildren
?:
()
=>
Omit
<
iMenuConfigItem
,
'getChildren'
>
[]
path
?:
string
belongToMenuName
?:
string
hiddeInMenu
?:
boolean
component
?:
Component
onClick
?:
(
e
:
Event
)
=>
any
routeName
?:
string
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment