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

对antd pro layout 是mix的,tab会多出一个 #44

Closed
imgoby opened this issue Jun 1, 2022 · 8 comments
Closed

对antd pro layout 是mix的,tab会多出一个 #44

imgoby opened this issue Jun 1, 2022 · 8 comments

Comments

@imgoby
Copy link

imgoby commented Jun 1, 2022

(1)在mix布局下,点击/aa,会跳转到/aa/bb,这时,页标签有两个:/aa、/aa/bb,有方法把/aa的页签去掉吗?只保留/aa/bb这个

{
    path: '/aa',
    name: 'aa',
    icon: 'dashboard',
    routes: [
        {
            name: 'bb',
            icon: 'smile',
            path: '/aa/bb',
            component: './aa/bb',
        },
        {
            path: '/aa',
            redirect: '/aa/bb',
        },
    ],
}
@yunsii
Copy link
Owner

yunsii commented Jun 1, 2022

应该跟布局类型无关吧,能提供一下截图吗?/aa 是怎么渲染的?

@imgoby
Copy link
Author

imgoby commented Jun 1, 2022

mix布局:
image

出现问题,
image

@imgoby
Copy link
Author

imgoby commented Jun 1, 2022

设置了分割菜单,这就让一级菜单可以点击了。但一级菜单是一个目录。所以就有问题了

@yunsii
Copy link
Owner

yunsii commented Jun 1, 2022

自动分割菜单这个功能是新 feature 吧,我研究一下再答复你,会尽快修复的。

@imgoby
Copy link
Author

imgoby commented Jun 1, 2022

谢谢

@yunsii
Copy link
Owner

yunsii commented Jun 5, 2022

问题解决了,由于 React Router 的 redirect 逻辑之前一直没处理 😂 按照之前 ant design pro 的菜单逻辑是不会自动触发 redirect 的,现在这个自动分割菜单的功能就会触发 redirect 了。

当前项目内实现可参考 commit:acdc50a
use-switch-tabs 中的处理:https://github.com/yunsii/use-switch-tabs/blob/master/src/utils.tsx#L45

@imgoby
Copy link
Author

imgoby commented Jun 5, 2022

thanku

@yunsii
Copy link
Owner

yunsii commented Jun 10, 2022

close as stale

@yunsii yunsii closed this as completed Jun 10, 2022
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