2019-05-25 21:01:21 +08:00
|
|
|
|
---
|
|
|
|
|
order: 10
|
|
|
|
|
title:
|
|
|
|
|
zh-CN: 可点击
|
|
|
|
|
en-US: Clickable
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
|
|
设置 `onChange` 后,Steps 变为可点击状态。
|
|
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
|
|
|
|
|
Setting `onChange` makes Steps clickable.
|
|
|
|
|
|
|
|
|
|
```jsx
|
|
|
|
|
import { Steps, Divider } from 'antd';
|
|
|
|
|
|
2019-05-27 21:32:45 +08:00
|
|
|
|
const { Step } = Steps;
|
2019-05-25 21:01:21 +08:00
|
|
|
|
|
|
|
|
|
class Demo extends React.Component {
|
|
|
|
|
state = {
|
|
|
|
|
current: 0,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onChange = current => {
|
|
|
|
|
console.log('onChange:', current);
|
|
|
|
|
this.setState({ current });
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { current } = this.state;
|
|
|
|
|
|
|
|
|
|
return (
|
2020-07-07 21:33:07 +08:00
|
|
|
|
<>
|
2019-05-25 21:01:21 +08:00
|
|
|
|
<Steps current={current} onChange={this.onChange}>
|
|
|
|
|
<Step title="Step 1" description="This is a description." />
|
|
|
|
|
<Step title="Step 2" description="This is a description." />
|
|
|
|
|
<Step title="Step 3" description="This is a description." />
|
|
|
|
|
</Steps>
|
|
|
|
|
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
|
|
<Steps current={current} onChange={this.onChange} direction="vertical">
|
|
|
|
|
<Step title="Step 1" description="This is a description." />
|
|
|
|
|
<Step title="Step 2" description="This is a description." />
|
|
|
|
|
<Step title="Step 3" description="This is a description." />
|
|
|
|
|
</Steps>
|
2020-07-07 21:33:07 +08:00
|
|
|
|
</>
|
2019-05-25 21:01:21 +08:00
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReactDOM.render(<Demo />, mountNode);
|
|
|
|
|
```
|