2019-09-06 16:35:13 +08:00
|
|
|
---
|
|
|
|
order: 8
|
|
|
|
title:
|
|
|
|
zh-CN: 反向
|
|
|
|
en-US: Reverse
|
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
设置 `reverse` 可以将滑动条置反。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
Using `reverse` to render slider reversely.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2019-09-06 16:35:13 +08:00
|
|
|
import { Slider, Switch } from 'antd';
|
2022-05-21 22:14:15 +08:00
|
|
|
import React, { useState } from 'react';
|
2019-09-06 16:35:13 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => {
|
|
|
|
const [reverse, setReverse] = useState(true);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Slider defaultValue={30} reverse={reverse} />
|
|
|
|
<Slider range defaultValue={[20, 50]} reverse={reverse} />
|
|
|
|
Reversed: <Switch size="small" checked={reverse} onChange={setReverse} />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default App;
|
2019-09-06 16:35:13 +08:00
|
|
|
```
|