mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 09:39:10 +08:00
6776bb8916
* docs: update demo * chore: add script * test: fix demo test * docs: convert demos * chore: move script * test: remove react-dom import * chore: update deps * docs: update riddle js * test: fix image test * docs: fix riddle demo
51 lines
727 B
Markdown
51 lines
727 B
Markdown
---
|
|
order: 6
|
|
title:
|
|
zh-CN: 垂直
|
|
en-US: Vertical
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
垂直方向的 Slider。
|
|
|
|
## en-US
|
|
|
|
The vertical Slider.
|
|
|
|
```jsx
|
|
import { Slider } from 'antd';
|
|
|
|
const style = {
|
|
display: 'inline-block',
|
|
height: 300,
|
|
marginLeft: 70,
|
|
};
|
|
|
|
const marks = {
|
|
0: '0°C',
|
|
26: '26°C',
|
|
37: '37°C',
|
|
100: {
|
|
style: {
|
|
color: '#f50',
|
|
},
|
|
label: <strong>100°C</strong>,
|
|
},
|
|
};
|
|
|
|
export default () => (
|
|
<>
|
|
<div style={style}>
|
|
<Slider vertical defaultValue={30} />
|
|
</div>
|
|
<div style={style}>
|
|
<Slider vertical range step={10} defaultValue={[20, 50]} />
|
|
</div>
|
|
<div style={style}>
|
|
<Slider vertical range marks={marks} defaultValue={[26, 37]} />
|
|
</div>
|
|
</>
|
|
);
|
|
```
|