mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 20:19:44 +08:00
fix: Breadcrumb 默认使用path作为唯一key (#21583)
* Breadcrumb 默认使用path作为唯一key * update&submit jest snapshot
This commit is contained in:
parent
afedb4127f
commit
12761e8382
@ -103,7 +103,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
overlay = (
|
||||
<Menu>
|
||||
{route.children.map(child => (
|
||||
<Menu.Item key={child.breadcrumbName || child.path}>
|
||||
<Menu.Item key={child.path || child.breadcrumbName}>
|
||||
{itemRender(child, params, routes, this.addChildPath(paths, child.path, params))}
|
||||
</Menu.Item>
|
||||
))}
|
||||
@ -112,7 +112,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
}
|
||||
|
||||
return (
|
||||
<BreadcrumbItem overlay={overlay} separator={separator} key={route.breadcrumbName || path}>
|
||||
<BreadcrumbItem overlay={overlay} separator={separator} key={path || route.breadcrumbName}>
|
||||
{itemRender(route, params, routes, paths)}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
|
@ -100,7 +100,7 @@ exports[`react router react router 3 1`] = `
|
||||
</span>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbItem
|
||||
key="Application List"
|
||||
key="apps"
|
||||
separator="/"
|
||||
>
|
||||
<span>
|
||||
@ -121,7 +121,7 @@ exports[`react router react router 3 1`] = `
|
||||
</span>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbItem
|
||||
key="Application:id"
|
||||
key="1"
|
||||
separator="/"
|
||||
>
|
||||
<span>
|
||||
@ -142,7 +142,7 @@ exports[`react router react router 3 1`] = `
|
||||
</span>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbItem
|
||||
key="Detail"
|
||||
key="detail"
|
||||
separator="/"
|
||||
>
|
||||
<span>
|
||||
|
Loading…
Reference in New Issue
Block a user