mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
973 B
973 B
order | title | ||||
---|---|---|---|---|---|
0 |
|
zh-CN
基本滑动条。当 range
为 true
时,渲染为双滑块。当 disabled
为 true
时,滑块处于不可用状态。
en-US
Basic slider. When range
is true
, display as dual thumb mode. When disable
is true
, the slider will not be interactable.
import { Slider, Switch } from 'antd';
class Demo extends React.Component {
state = {
disabled: false,
};
handleDisabledChange = disabled => {
this.setState({ disabled });
};
render() {
const { disabled } = this.state;
return (
<>
<Slider defaultValue={30} disabled={disabled} />
<Slider range defaultValue={[20, 50]} disabled={disabled} />
Disabled: <Switch size="small" checked={disabled} onChange={this.handleDisabledChange} />
</>
);
}
}
ReactDOM.render(<Demo />, mountNode);