2020-03-22 11:38:02 +08:00
|
|
|
---
|
|
|
|
order: 3
|
|
|
|
title:
|
|
|
|
zh-CN: 自定义尺寸
|
|
|
|
en-US: Customize Size
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
自定义间距大小。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Custom spacing size.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2022-05-21 22:14:15 +08:00
|
|
|
import { Button, Slider, Space } from 'antd';
|
2020-03-22 11:38:02 +08:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => {
|
2020-03-22 11:38:02 +08:00
|
|
|
const [size, setSize] = useState(8);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Slider value={size} onChange={value => setSize(value)} />
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<Space size={size}>
|
|
|
|
<Button type="primary">Primary</Button>
|
|
|
|
<Button>Default</Button>
|
|
|
|
<Button type="dashed">Dashed</Button>
|
|
|
|
<Button type="link">Link</Button>
|
|
|
|
</Space>
|
|
|
|
</>
|
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
};
|
2020-03-22 11:38:02 +08:00
|
|
|
|
2022-04-28 20:54:19 +08:00
|
|
|
export default App;
|
2020-03-22 11:38:02 +08:00
|
|
|
```
|