11import type { DId , DSize } from '../../utils/types' ;
22import type { DDropdownItem } from '../dropdown' ;
33
4- import { nth } from 'lodash' ;
4+ import { isUndefined , nth } from 'lodash' ;
55import React , { useEffect , useImperativeHandle , useRef , useState } from 'react' ;
66
77import { useEventCallback , useId , useIsomorphicLayoutEffect , useResize } from '@react-devui/hooks' ;
@@ -21,6 +21,7 @@ export interface DTabItem<ID extends DId> {
2121 id : ID ;
2222 title : React . ReactNode ;
2323 panel : React . ReactNode ;
24+ dropdownItem ?: React . ReactNode ;
2425 disabled ?: boolean ;
2526 closable ?: boolean ;
2627}
@@ -343,7 +344,7 @@ function Tabs<ID extends DId, T extends DTabItem<ID>>(props: DTabsProps<ID, T>,
343344 { listOverflow && (
344345 < DDropdown
345346 dList = { dropdownList . map < DDropdownItem < ID > > ( ( tab ) => {
346- const { id : itemId , title : itemTitle , disabled : itemDisabled } = tab ;
347+ const { id : itemId , title : itemTitle , dropdownItem : itemDropdownItem , disabled : itemDisabled } = tab ;
347348
348349 return {
349350 id : itemId ,
@@ -353,7 +354,7 @@ function Tabs<ID extends DId, T extends DTabItem<ID>>(props: DTabsProps<ID, T>,
353354 'is-active' : itemId === activeId ,
354355 } ) }
355356 >
356- { itemTitle }
357+ { isUndefined ( itemDropdownItem ) ? itemTitle : itemDropdownItem }
357358 </ span >
358359 ) ,
359360 type : 'item' ,
0 commit comments