Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

约定式路由如何生成layout所需的嵌套菜单 #12801

Open
senjyouhara opened this issue Nov 24, 2024 · 1 comment
Open

约定式路由如何生成layout所需的嵌套菜单 #12801

senjyouhara opened this issue Nov 24, 2024 · 1 comment

Comments

@senjyouhara
Copy link

image

image

我菜单结构是这样的,希望能生成这样的菜单,但因为约定式路由会进行扁平化导致生成的路由是这样

image

如何能生成嵌套结构的菜单呢

layout配置如下

export const layout: RunTimeLayoutConfig = () => {
    return {
        title: config.title,
        logo: config.logo,
        layout: 'mix',
        fixedHeader: true,
        fixSiderbar: true,
        rightContentRender: () => <RightContent />,
        contentStyle: {
            padding: 16,
            height: `calc(100vh - 56px)`,
            overflow: 'auto',
        },
        // 其他属性见:https://procomponents.ant.design/components/layout#prolayout
    };
};

还有个问题如何约定菜单展示的排序

@jk4235
Copy link

jk4235 commented Dec 3, 2024

菜单是你自己控制的,onClick的时候history.push到对应的路由就行了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants