diff --git a/src/breadcrumb/BreadcrumbItem.tsx b/src/breadcrumb/BreadcrumbItem.tsx index 0253469a56..26bb5ea55d 100644 --- a/src/breadcrumb/BreadcrumbItem.tsx +++ b/src/breadcrumb/BreadcrumbItem.tsx @@ -33,6 +33,7 @@ const BreadcrumbItem = forwardRef((props, r className, content, onClick, + tooltipProps, ...restProps } = useDefaultProps(props, breadcrumbItemDefaultProps); @@ -95,7 +96,13 @@ const BreadcrumbItem = forwardRef((props, r return (
- {isCutOff ? {itemContent} : itemContent} + {isCutOff ? ( + + {itemContent} + + ) : ( + itemContent + )} {separatorContent}
); diff --git a/src/breadcrumb/breadcrumb.en-US.md b/src/breadcrumb/breadcrumb.en-US.md index 364ded77fd..9e3d27164c 100644 --- a/src/breadcrumb/breadcrumb.en-US.md +++ b/src/breadcrumb/breadcrumb.en-US.md @@ -29,4 +29,5 @@ replace | Boolean | false | \- | N router | Object | - | Typescript:`any` | N target | String | _self | options: _blank/_self/_parent/_top | N to | String / Object | - | Typescript:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/breadcrumb/type.ts) | N +tooltipProps | Object | - | Typescript:`TooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-react/blob/develop/src/breadcrumb/type.ts) | N onClick | Function | | Typescript:`(e: MouseEvent) => void`
trigger on click | N diff --git a/src/breadcrumb/breadcrumb.md b/src/breadcrumb/breadcrumb.md index a87ff10054..0c61f4c680 100644 --- a/src/breadcrumb/breadcrumb.md +++ b/src/breadcrumb/breadcrumb.md @@ -29,4 +29,5 @@ replace | Boolean | false | 路由跳转是否采用覆盖的方式(覆盖后 router | Object | - | 路由对象。如果项目存在 Router,则默认使用 Router。TS 类型:`any` | N target | String | _self | 链接或路由跳转方式。可选项:_blank/_self/_parent/_top | N to | String / Object | - | 路由跳转目标,当且仅当 Router 存在时,该 API 有效。TS 类型:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/breadcrumb/type.ts) | N +tooltipProps | Object | - | 透传提示组件属性。TS 类型:`TooltipProps`,[Tooltip API Documents](./tooltip?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-react/blob/develop/src/breadcrumb/type.ts) | N onClick | Function | | TS 类型:`(e: MouseEvent) => void`
点击时触发 | N diff --git a/src/breadcrumb/type.ts b/src/breadcrumb/type.ts index ba4d309592..cb3bcbcfff 100644 --- a/src/breadcrumb/type.ts +++ b/src/breadcrumb/type.ts @@ -4,6 +4,7 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ +import { TooltipLiteProps as TooltipProps } from '../tooltip'; import { TNode, TElement } from '../common'; import { MouseEvent } from 'react'; @@ -66,6 +67,10 @@ export interface TdBreadcrumbItemProps { * 路由跳转目标,当且仅当 Router 存在时,该 API 有效 */ to?: string | Route; + /** + * 透传提示组件属性 + */ + tooltipProps?: TooltipProps; /** * 点击时触发 */