Commit cc5c8155 authored by 拷钉's avatar 拷钉 Committed by 陈帅

hiddenBreadcrumb && menu.disableLocal (#4009)

* menu.disableLocal

* hiddenBreadcrumb

* lint

* lint
parent edd2962e
import React from 'react';
// eslint-disable-next-line import/no-cycle
import PromiseRender from './PromiseRender';
import { CURRENT } from './renderAuthorize';
......
import { Spin } from 'antd';
import isEqual from 'lodash/isEqual';
import React from 'react';
// eslint-disable-next-line import/no-cycle
import { isComponentClass } from './Secured';
export default class PromiseRender extends React.Component {
......
import React from 'react';
import Exception from '../Exception';
// eslint-disable-next-line import/no-cycle
import CheckPermissions from './CheckPermissions';
/**
......
......@@ -3,6 +3,7 @@ import pathToRegexp from 'path-to-regexp';
import Link from 'umi/link';
import { formatMessage } from 'umi-plugin-react/locale';
import { urlToList } from '../_utils/pathTools';
import { menu } from '../../defaultSettings';
// 渲染Breadcrumb 子节点
// Render the Breadcrumb child node
......@@ -21,7 +22,10 @@ const itemRender = (route, params, routes, paths) => {
const renderItemLocal = item => {
if (item.locale) {
return formatMessage({ id: item.locale, defaultMessage: item.name });
const name = menu.disableLocal
? item.name
: formatMessage({ id: item.locale, defaultMessage: item.name });
return name;
}
return item.name;
};
......
......@@ -44,6 +44,7 @@ const PageHeaderWrapper = ({
content,
logo,
extraContent,
hiddenBreadcrumb,
...restProps
}) => {
return (
......@@ -66,11 +67,14 @@ const PageHeaderWrapper = ({
}
key="pageheader"
{...restProps}
breadcrumb={conversionBreadcrumbList({
...value,
...restProps,
home: <FormattedMessage id="menu.home" defaultMessage="Home" />,
})}
breadcrumb={
!hiddenBreadcrumb &&
conversionBreadcrumbList({
...value,
...restProps,
home: <FormattedMessage id="menu.home" defaultMessage="Home" />,
})
}
className={styles.pageHeader}
linkElement={Link}
footer={renderFooter(restProps)}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment