umi 项目使用 Ant Design Pro ProLayout 组件在添加 base 或开启 hash 时菜单不能正常选中。
解决方法:
传入 location
即可:
- const IndexPage: React.FC<BasicLayoutProps> = (props) => {
- const { location, children } = props;
- ...
- return (
- <ProLayout
- location={location}
- ...
- >
- {children}
- </ProLayout>
- );
- };
- export default IndexPage;
未经允许不得转载:前端资源网 - w3h5 » umi项目antd pro ProLayout添加base或开启hash时菜单不能正常选中的解决方法