@@ -80,6 +80,7 @@ const DraggableTab: React.FC<TabsProps & { onItemsChange?: (items: any[]) => voi | |||||
)} | )} | ||||
{...props} | {...props} | ||||
items={items} | items={items} | ||||
tabBarStyle={{ marginBottom: 8 }} | |||||
className='tab-layout' | className='tab-layout' | ||||
/> | /> | ||||
); | ); | ||||
@@ -46,6 +46,7 @@ export function useTabs() { | |||||
// 关闭除了自己其它tab | // 关闭除了自己其它tab | ||||
const closeOtherTab = useCallback((routePath: string = activeTabRoutePath) => { | const closeOtherTab = useCallback((routePath: string = activeTabRoutePath) => { | ||||
setKeepAliveTabs(prev => prev.filter(o => o.routePath === routePath)); | setKeepAliveTabs(prev => prev.filter(o => o.routePath === routePath)); | ||||
router.navigate(routePath); | |||||
}, [activeTabRoutePath]); | }, [activeTabRoutePath]); | ||||
// 刷新tab | // 刷新tab | ||||
@@ -18,7 +18,7 @@ const Content: FC<any> = ({ children }) => { | |||||
style={{ | style={{ | ||||
borderRadius: '8px', | borderRadius: '8px', | ||||
marginLeft: collapsed ? 100 : defaultSetting.slideWidth, | marginLeft: collapsed ? 100 : defaultSetting.slideWidth, | ||||
minHeight: 'calc(100vh - 80px)', | |||||
minHeight: 'calc(100vh - 60px)', | |||||
transition: "all 200ms cubic-bezier(0.4, 0, 0.6, 1) 0ms", | transition: "all 200ms cubic-bezier(0.4, 0, 0.6, 1) 0ms", | ||||
width: `calc(100vw - ${isPC ? collapsed ? 100 : defaultSetting.slideWidth : 32}px)` | width: `calc(100vw - ${isPC ? collapsed ? 100 : defaultSetting.slideWidth : 32}px)` | ||||
}} | }} | ||||
@@ -38,7 +38,6 @@ const TabsLayout: React.FC = () => { | |||||
].filter(o => o !== null) as MenuItemType[], | ].filter(o => o !== null) as MenuItemType[], | ||||
[tabs] | [tabs] | ||||
); | ); | ||||
const menuClick = useCallback(({ key, domEvent }: any, tab: KeepAliveTab) => { | const menuClick = useCallback(({ key, domEvent }: any, tab: KeepAliveTab) => { | ||||
domEvent.stopPropagation(); | domEvent.stopPropagation(); | ||||
@@ -55,7 +54,7 @@ const TabsLayout: React.FC = () => { | |||||
return ( | return ( | ||||
<Dropdown | <Dropdown | ||||
menu={{ items: menuItems, onClick: (e) => menuClick(e, tab) }} | menu={{ items: menuItems, onClick: (e) => menuClick(e, tab) }} | ||||
trigger={['contextMenu']} | |||||
trigger={['hover']} | |||||
> | > | ||||
<div style={{ margin: '-12px 0', padding: '12px 0' }}> | <div style={{ margin: '-12px 0', padding: '12px 0' }}> | ||||
{getIcon(tab.icon)} | {getIcon(tab.icon)} | ||||