mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 15:19:58 +08:00
21 lines
494 B
TypeScript
21 lines
494 B
TypeScript
|
import React, { useState } from 'react';
|
||
|
import { Slider, Switch } from 'antd';
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const [disabled, setDisabled] = useState(false);
|
||
|
|
||
|
const onChange = (checked: boolean) => {
|
||
|
setDisabled(checked);
|
||
|
};
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<Slider defaultValue={30} disabled={disabled} />
|
||
|
<Slider range defaultValue={[20, 50]} disabled={disabled} />
|
||
|
Disabled: <Switch size="small" checked={disabled} onChange={onChange} />
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|