未验证 提交 d5b50464 编写于 作者: 陈帅 提交者: GitHub

add isUrl judge (#4681)

如果是 url 不再需要将其放到 Link 中

close #4607
上级 f715d9f7
......@@ -54,7 +54,7 @@
"not ie <= 10"
],
"dependencies": {
"@ant-design/pro-layout": "^4.5.7",
"@ant-design/pro-layout": "^4.5.9",
"@antv/data-set": "^0.10.2",
"antd": "^3.20.0",
"classnames": "^2.2.6",
......
......@@ -16,15 +16,16 @@ import { formatMessage } from 'umi-plugin-react/locale';
import Authorized from '@/utils/Authorized';
import RightContent from '@/components/GlobalHeader/RightContent';
import { ConnectProps, ConnectState } from '@/models/connect';
import { ConnectState, Dispatch } from '@/models/connect';
import { isAntDesignPro } from '@/utils/utils';
import logo from '../assets/logo.svg';
export interface BasicLayoutProps extends ProLayoutProps, Omit<ConnectProps, 'location'> {
export interface BasicLayoutProps extends ProLayoutProps {
breadcrumbNameMap: {
[path: string]: MenuDataItem;
};
settings: Settings;
dispatch: Dispatch;
}
export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & {
breadcrumbNameMap: {
......@@ -100,9 +101,12 @@ const BasicLayout: React.FC<BasicLayoutProps> = props => {
<ProLayout
logo={logo}
onCollapse={handleMenuCollapse}
menuItemRender={(menuItemProps, defaultDom) => (
<Link to={menuItemProps.path}>{defaultDom}</Link>
)}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl) {
return defaultDom;
}
return <Link to={menuItemProps.path}>{defaultDom}</Link>;
}}
breadcrumbRender={(routers = []) => [
{
path: '/',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册