mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 04:18:28 +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;
|