Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-layout
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
pro-layout
Commits
c37c1e9c
Unverified
Commit
c37c1e9c
authored
Feb 24, 2021
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: child route
parent
f2cfa04c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
1 deletion
+37
-1
child-page.tsx
examples/demo/child/child-page.tsx
+12
-0
index.tsx
examples/index.tsx
+22
-0
BaseMenu.tsx
src/SiderMenu/BaseMenu.tsx
+3
-1
No files found.
examples/demo/child/child-page.tsx
0 → 100644
View file @
c37c1e9c
import
{
defineComponent
}
from
'vue'
;
export
default
defineComponent
({
setup
()
{
return
()
=>
(
<
div
>
<
h1
>
Child
</
h1
>
<
router
-
view
/>
</
div
>
);
},
});
examples/index.tsx
View file @
c37c1e9c
...
...
@@ -13,6 +13,7 @@ import registerIcons from './_util/icons';
import
Page1
from
'./demo/page1'
;
import
Welcome
from
'./demo/welcome'
;
import
FormPage
from
'./demo/form'
;
import
ChildPage
from
'./demo/child/child-page'
;
const
getMenuData
=
(
routes
:
RouteRecord
[])
=>
{
const
childrenRoute
=
routes
.
find
(
route
=>
route
.
path
===
'/'
);
...
...
@@ -179,6 +180,27 @@ const routes = [
meta
:
{
icon
:
'SmileOutlined'
,
title
:
'Advanced Form'
},
component
:
FormPage
,
},
{
path
:
'/form/child'
,
name
:
'child-form'
,
meta
:
{
icon
:
'SmileOutlined'
,
hideInMenu
:
true
,
title
:
'Child Form'
},
redirect
:
'/form/child/page1'
,
component
:
ChildPage
,
children
:
[
{
path
:
'/form/child/page1'
,
name
:
'child-page1-form'
,
meta
:
{
title
:
'Page1 Child'
},
component
:
FormPage
,
},
{
path
:
'/form/child/page2'
,
name
:
'child-page2-form'
,
meta
:
{
title
:
'Page2 Child'
},
component
:
FormPage
,
},
],
},
],
},
];
...
...
src/SiderMenu/BaseMenu.tsx
View file @
c37c1e9c
...
...
@@ -174,7 +174,9 @@ class MenuUtil {
</
span
>
</
CustomTag
>
)
:
(
<
CustomTag
{
...
attrs
}
{
...
props
}
>
<
span
class=
{
`${prefixCls}-menu-item`
}
>
{
menuTitle
}
</
span
>
</
CustomTag
>
);
return
defaultTitle
;
...
...
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