#
Junjie
2024-03-21 23d6aacaad1d5fbf7ca78b407e489a39f61ce181
#
1个文件已修改
21 ■■■■■ 已修改文件
zy-asrs-flow/src/services/route.js 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/services/route.js
@@ -77,14 +77,21 @@
    for (const menu of children) {
        if (menu.component !== null && menu.component !== undefined) {
            // children
            const Component = require(`@/pages${menu.path}/index.jsx`).default
            const newRoute = {
                name: menu.name,
                path: menu.path,
                element: <Component />,
            let Component;
            try {
                Component = require(`@/pages${menu.path}/index.jsx`).default
            } catch (error) {
                console.error('An error has occurred: ', error);
            }
            parent.routes.push(newRoute);
            parent.children.push(newRoute);
            if (Component) {
                const newRoute = {
                    name: menu.name,
                    path: menu.path,
                    element: <Component />,
                }
                parent.routes.push(newRoute);
                parent.children.push(newRoute);
            }
        } else {
            // parent
            const newRoute = {