docs: add docs for TimePicker[defaultOpenValue], close: #6336

This commit is contained in:
Benjy Cui 2017-06-02 14:28:56 +08:00
parent 9bb7ec0b87
commit ef54b60add
3 changed files with 7 additions and 1 deletions

View File

@ -15,10 +15,14 @@ Click `TimePicker`, and then we could select or input a time in panel.
````jsx
import { TimePicker } from 'antd';
import moment from 'moment';
function onChange(time, timeString) {
console.log(time, timeString);
}
ReactDOM.render(<TimePicker onChange={onChange} />, mountNode);
ReactDOM.render(
<TimePicker onChange={onChange} defaultOpenValue={moment('00:00:00', 'HH:mm:ss')} />,
mountNode
);
````

View File

@ -23,6 +23,7 @@ import moment from 'moment';
|---------------------|-----|-----|-------|
| defaultValue | to set default time | [moment](http://momentjs.com/) | - |
| value | to set time | [moment](http://momentjs.com/) | - |
| defaultOpenValue | to highlight values in panel when there is no selected value | [moment](http://momentjs.com/) | moment() |
| open | whether to popup panel | boolean | false |
| onOpenChange | a callback function which will be called while panel opening/closing | (open: boolean): void | - |
| placeholder | display when there's no value | string | "Select a time" |

View File

@ -24,6 +24,7 @@ import moment from 'moment';
|---------------------|-----|-----|-------|
| defaultValue | 默认时间 | [moment](http://momentjs.com/) | 无 |
| value | 当前时间 | [moment](http://momentjs.com/) | 无 |
| defaultOpenValue | 无选中值时,面板打开时高亮的值 | [moment](http://momentjs.com/) | moment() |
| open | 面板是否打开 | boolean | false |
| onOpenChange | 面板打开/关闭时的回调 | (open: boolean): void | 无 |
| placeholder | 没有值的时候显示的内容 | string | "请选择时间" |