Unverified Commit c37c1e9c authored by Sendya's avatar Sendya

fix: child route

parent f2cfa04c
import { defineComponent } from 'vue';
export default defineComponent({
setup() {
return () => (
<div>
<h1>Child</h1>
<router-view />
</div>
);
},
});
......@@ -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,
},
],
},
],
},
];
......
......@@ -174,7 +174,9 @@ class MenuUtil {
</span>
</CustomTag>
) : (
<span class={`${prefixCls}-menu-item`}>{menuTitle}</span>
<CustomTag {...attrs} {...props}>
<span class={`${prefixCls}-menu-item`}>{menuTitle}</span>
</CustomTag>
);
return defaultTitle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment