fix: jsx throw error

pull/2386/head
tanjinzhou 2020-06-09 15:54:11 +08:00
parent 1884a7c4c6
commit 51b2d2f5ad
1 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import { ConfigConsumerProps } from '../config-provider';
import BreadcrumbItem from './BreadcrumbItem'; import BreadcrumbItem from './BreadcrumbItem';
import Menu from '../menu'; import Menu from '../menu';
const MenuItem = Menu.Item;
const Route = PropTypes.shape({ const Route = PropTypes.shape({
path: PropTypes.string, path: PropTypes.string,
breadcrumbName: PropTypes.string, breadcrumbName: PropTypes.string,
@ -77,7 +78,7 @@ export default {
overlay = ( overlay = (
<Menu> <Menu>
{route.children.map(child => ( {route.children.map(child => (
<Menu.Item key={child.breadcrumbName || child.path}> <MenuItem key={child.breadcrumbName || child.path}>
{itemRender({ {itemRender({
route: child, route: child,
params, params,
@ -85,7 +86,7 @@ export default {
paths: this.addChildPath(paths, child.path, params), paths: this.addChildPath(paths, child.path, params),
h: this.$createElement, h: this.$createElement,
})} })}
</Menu.Item> </MenuItem>
))} ))}
</Menu> </Menu>
); );