#
luxiaotao1123
2024-01-31 cdd725bf762c5bc140d291d7c6a1c3509e686fd3
#
1个文件已修改
52 ■■■■ 已修改文件
zy-asrs-flow/src/pages/Admin.jsx 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/Admin.jsx
@@ -58,26 +58,46 @@
    );
};
const menuList = [
    {
        "name": '列表页面',
        "path": "/path1",
        "component": Hello
    },
    // ...其它项
]
const route = {
    route: {
        path: '/',
        routes: menuList
        routes: [
            {
                name: '列表页',
                path: '/list',
                component: './ListTableList',
                routes: [
                    {
                        path: '/list/sub-page',
                        name: '列表页面',
                        routes: [
                            {
                                path: 'sub-sub-page1',
                                name: '一级列表页面',
                                component: './Hello',
                            },
                            {
                                path: 'hello',
                                name: '你好世界',
                                component: 'Hello',
                            },
                        ],
                    },
                ],
            },
        ]
    },
    location: {
        pathname: '/',
    },
}
console.log(route);
console.log(defaultProps);
const menu0 = [
    {
        "path": "/path2",
        "component": Hello
    }
]
export default () => {
    if (typeof document === 'undefined') {
@@ -136,7 +156,7 @@
                                width: '331px',
                            },
                        ]}
                        {...defaultProps}
                        {...route}
                        location={{
                            pathname,
                        }}
@@ -214,7 +234,8 @@
                        menuItemRender={(item, dom) => (
                            <div
                                onClick={() => {
                                    setPathname(item.path || '/welcome');
                                    console.log(dom);
                                    setPathname(item.path);
                                }}
                            >
                                {dom}
@@ -226,8 +247,9 @@
                        {/* <G6></G6> */}
                        <PageContainer>
                            <Routes>
                                <Route path="/list/sub-page/hello" element={<Hello />} />
                                {/* 根据实际路由继续添加更多的 Route */}
                                {menu0.map(item =>
                                    <Route key={item.path} path={item.path} element={React.createElement(item.component)} />
                                )}
                            </Routes>
                            {/* <G6></G6> */}
                        </PageContainer>