Skip to content

Commit

Permalink
fix(types): breadcrumbProps (#7760)
Browse files Browse the repository at this point in the history
  • Loading branch information
kungege authored Oct 9, 2023
1 parent 7ddce1b commit fb1090c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/layout/src/ProLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { getMatchMenu } from '@umijs/route-utils';
import type { BreadcrumbProps } from 'antd';
import { ConfigProvider, Layout } from 'antd';
import type { ItemType } from 'antd/es/breadcrumb/Breadcrumb';
import type { AnyObject } from 'antd/es/_util/type';
import classNames from 'classnames';
import Omit from 'omit.js';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
Expand Down Expand Up @@ -60,10 +61,15 @@ import { WrapContent } from './WrapContent';

let layoutIndex = 0;

export type LayoutBreadcrumbProps = {
type LayoutItemType = ItemType & { linkPath?: string; component?: string };

export type LayoutBreadcrumbProps<T extends AnyObject = AnyObject> = {
minLength?: number;
itemRender?: (
route: ItemType & { linkPath?: string; component?: string },
route: LayoutItemType,
params: T,
routes: LayoutItemType[],
paths: string[],
) => React.ReactNode;
};

Expand Down

0 comments on commit fb1090c

Please sign in to comment.