powersir 11 місяці тому
джерело
коміт
763a49da3c
3 змінених файлів з 12 додано та 3 видалено
  1. +2
    -1
      src/components/draggable-tab/index.tsx
  2. +0
    -1
      src/layout/content/index.tsx
  3. +10
    -1
      src/layout/tabs-layout.tsx

+ 2
- 1
src/components/draggable-tab/index.tsx Переглянути файл

@@ -65,6 +65,7 @@ const DraggableTab: React.FC<TabsProps & { onItemsChange?: (items: any[]) => voi

return (
<Tabs
style={{ position: 'relative' }}
renderTabBar={(tabBarProps, DefaultTabBar) => (
<DndContext sensors={[sensor]} onDragEnd={onDragEnd} modifiers={[restrictToHorizontalAxis]}>
<SortableContext items={items.map((i) => i.key)} strategy={horizontalListSortingStrategy}>
@@ -80,7 +81,7 @@ const DraggableTab: React.FC<TabsProps & { onItemsChange?: (items: any[]) => voi
)}
{...props}
items={items}
tabBarStyle={{ marginBottom: 8 }}
tabBarStyle={{ marginBottom: 8, position: 'sticky', top: 0, zIndex: 997}}
className='tab-layout'
/>
);


+ 0
- 1
src/layout/content/index.tsx Переглянути файл

@@ -18,7 +18,6 @@ const Content: FC<any> = ({ children }) => {
style={{
borderRadius: '8px',
marginLeft: collapsed ? 100 : defaultSetting.slideWidth,
minHeight: 'calc(100vh - 60px)',
transition: "all 200ms cubic-bezier(0.4, 0, 0.6, 1) 0ms",
width: `calc(100vw - ${isPC ? collapsed ? 100 : defaultSetting.slideWidth : 32}px)`
}}


+ 10
- 1
src/layout/tabs-layout.tsx Переглянути файл

@@ -73,8 +73,17 @@ const TabsLayout: React.FC = () => {
<div
key={tab.key}
className='px-[16px]'
style={{
height: 'calc(100vh - 107px)'
}}
>
{tab.children}
<div style={{
height: '100%',
overflow: 'auto'
}}>
{tab.children}
</div>

</div>
),
closable: tabs.length > 1, // 剩最后一个就不能删除了


Завантаження…
Відмінити
Зберегти