mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-26 01:42:30 +08:00
25 lines
459 B
Markdown
25 lines
459 B
Markdown
# 选择日期
|
|
|
|
- order: 2
|
|
|
|
通过设置选择日期的回调事件 `onChange`,完成交互行为。
|
|
|
|
---
|
|
|
|
````jsx
|
|
import { Datepicker } from 'antd';
|
|
|
|
const Picker = React.createClass({
|
|
handleChange: function(value) {
|
|
console.log(new Date(value.getTime()));
|
|
},
|
|
render: function() {
|
|
return <Datepicker onChange={this.handleChange} />;
|
|
}
|
|
});
|
|
|
|
ReactDOM.render(
|
|
<Picker />
|
|
, document.getElementById('components-datepicker-demo-select'));
|
|
````
|