diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index 3a4a46e1ac..22401bf385 100755 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -5,17 +5,22 @@ import warning from '../_util/warning'; import BreadcrumbItem from './BreadcrumbItem'; import classNames from 'classnames'; +export interface Route { + path: string; + breadcrumbName: string; +} + export interface BreadcrumbProps { prefixCls?: string; - routes?: Array; - params?: Object; + routes?: Route[]; + params?: any; separator?: React.ReactNode; itemRender?: (route: any, params: any, routes: Array, paths: Array) => React.ReactNode; style?: React.CSSProperties; className?: string; } -function getBreadcrumbName(route, params) { +function getBreadcrumbName(route: Route, params: any) { if (!route.breadcrumbName) { return null; } @@ -27,7 +32,7 @@ function getBreadcrumbName(route, params) { return name; } -function defaultItemRender(route, params, routes, paths) { +function defaultItemRender(route: Route, params: any, routes: Route[], paths: string[]) { const isLastItem = routes.indexOf(route) === routes.length - 1; const name = getBreadcrumbName(route, params); return isLastItem