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

25 lines
452 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
通过设置选择日期的回调事件 `onSelect`,完成交互行为。
2015-05-26 13:58:35 +08:00
---
````jsx
var Datepicker = antd.datepicker;
var Picker = React.createClass({
handleChange: function(value) {
console.log(new Date(value.getTime()));
},
render: function() {
return <Datepicker onSelect={this.handleChange} />
}
});
React.render(
<Picker />
, document.getElementById('components-datepicker-demo-select'));
````