2020-03-22 11:38:02 +08:00
|
|
|
---
|
|
|
|
order: 3
|
|
|
|
title:
|
|
|
|
zh-CN: 自定义尺寸
|
|
|
|
en-US: Customize Size
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
自定义间距大小。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Custom spacing size.
|
|
|
|
|
|
|
|
```jsx
|
|
|
|
import React, { useState } from 'react';
|
|
|
|
import { Space, Slider, Button } from 'antd';
|
|
|
|
|
2020-04-16 12:28:04 +08:00
|
|
|
function SpaceCustomizeSize() {
|
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-04-03 23:27:45 +08:00
|
|
|
export default () => <SpaceCustomizeSize />;
|
2020-03-22 11:38:02 +08:00
|
|
|
```
|