2024-09-09 19:23:25 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { Flex, Splitter, Typography } from 'antd';
|
|
|
|
|
2024-09-10 22:35:32 +08:00
|
|
|
const Desc: React.FC<Readonly<{ text?: string | number }>> = (props) => (
|
2024-09-09 19:23:25 +08:00
|
|
|
<Flex justify="center" align="center" style={{ height: '100%' }}>
|
2024-09-10 22:35:32 +08:00
|
|
|
<Typography.Title type="secondary" level={5} style={{ whiteSpace: 'nowrap' }}>
|
|
|
|
Panel {props.text}
|
2024-09-09 19:23:25 +08:00
|
|
|
</Typography.Title>
|
|
|
|
</Flex>
|
|
|
|
);
|
|
|
|
|
|
|
|
const App: React.FC = () => (
|
|
|
|
<Flex vertical gap="middle">
|
|
|
|
<Typography.Title level={3}>[true, 0, false]</Typography.Title>
|
2024-09-10 22:35:32 +08:00
|
|
|
<Splitter style={{ height: 200, boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)' }}>
|
|
|
|
<Splitter.Panel>
|
|
|
|
<Desc text={1} />
|
|
|
|
</Splitter.Panel>
|
|
|
|
<Splitter.Panel defaultSize={0}>
|
|
|
|
<Desc text={2} />
|
|
|
|
</Splitter.Panel>
|
|
|
|
<Splitter.Panel resizable={false}>
|
|
|
|
<Desc text={3} />
|
|
|
|
</Splitter.Panel>
|
2024-09-09 19:23:25 +08:00
|
|
|
</Splitter>
|
|
|
|
<Typography.Title level={3}>[false, 0, true]</Typography.Title>
|
2024-09-10 22:35:32 +08:00
|
|
|
<Splitter style={{ height: 200, boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)' }}>
|
|
|
|
<Splitter.Panel resizable={false}>
|
|
|
|
<Desc text={1} />
|
|
|
|
</Splitter.Panel>
|
|
|
|
<Splitter.Panel defaultSize={0}>
|
|
|
|
<Desc text={2} />
|
|
|
|
</Splitter.Panel>
|
|
|
|
<Splitter.Panel>
|
|
|
|
<Desc text={3} />
|
|
|
|
</Splitter.Panel>
|
2024-09-09 19:23:25 +08:00
|
|
|
</Splitter>
|
|
|
|
<Typography.Title level={3}>Start have min & max</Typography.Title>
|
2024-09-10 22:35:32 +08:00
|
|
|
<Splitter style={{ height: 200, boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)' }}>
|
2024-09-09 19:23:25 +08:00
|
|
|
<Splitter.Panel min={50} max={100}>
|
2024-09-10 22:35:32 +08:00
|
|
|
<Desc text={1} />
|
|
|
|
</Splitter.Panel>
|
|
|
|
<Splitter.Panel>
|
|
|
|
<Desc text={2} />
|
2024-09-09 19:23:25 +08:00
|
|
|
</Splitter.Panel>
|
|
|
|
</Splitter>
|
|
|
|
<Typography.Title level={3}>End have min & max</Typography.Title>
|
2024-09-10 22:35:32 +08:00
|
|
|
<Splitter style={{ height: 200, boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)' }}>
|
|
|
|
<Splitter.Panel>
|
|
|
|
<Desc text={1} />
|
|
|
|
</Splitter.Panel>
|
2024-09-09 19:23:25 +08:00
|
|
|
<Splitter.Panel min="20%" max="70%">
|
2024-09-10 22:35:32 +08:00
|
|
|
<Desc text={2} />
|
2024-09-09 19:23:25 +08:00
|
|
|
</Splitter.Panel>
|
|
|
|
</Splitter>
|
|
|
|
</Flex>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default App;
|