ant-design/components/datepicker/demo/select.md

25 lines
459 B
Markdown
Raw Normal View History

2015-05-27 20:41:16 +08:00
# 选择日期
2015-05-26 13:58:35 +08:00
2015-05-27 20:41:16 +08:00
- order: 2
2015-06-02 17:20:02 +08:00
通过设置选择日期的回调事件 `onChange`,完成交互行为。
2015-05-26 13:58:35 +08:00
---
````jsx
import { Datepicker } from 'antd';
2015-05-26 13:58:35 +08:00
const Picker = React.createClass({
2015-05-26 13:58:35 +08:00
handleChange: function(value) {
console.log(new Date(value.getTime()));
},
render: function() {
return <Datepicker onChange={this.handleChange} />;
2015-05-26 13:58:35 +08:00
}
});
2015-10-20 16:47:55 +08:00
ReactDOM.render(
2015-05-26 13:58:35 +08:00
<Picker />
, document.getElementById('components-datepicker-demo-select'));
````