Przeglądaj źródła

update: container style

dev
powersir 1 rok temu
rodzic
commit
78b9f52d76
3 zmienionych plików z 12 dodań i 3 usunięć
  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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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 Wyświetl plik

@@ -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, // 剩最后一个就不能删除了


Ładowanie…
Anuluj
Zapisz