Browse Source

Merge branch 'feature' into preview

dev
powersir 11 months ago
parent
commit
fcb161683e
4 changed files with 4 additions and 3 deletions
  1. +1
    -0
      src/components/draggable-tab/index.tsx
  2. +1
    -0
      src/hooks/use-tabs/index.tsx
  3. +1
    -1
      src/layout/content/index.tsx
  4. +1
    -2
      src/layout/tabs-layout.tsx

+ 1
- 0
src/components/draggable-tab/index.tsx View File

@@ -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'
/> />
); );


+ 1
- 0
src/hooks/use-tabs/index.tsx View File

@@ -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


+ 1
- 1
src/layout/content/index.tsx View File

@@ -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)`
}} }}


+ 1
- 2
src/layout/tabs-layout.tsx View File

@@ -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)}


Loading…
Cancel
Save