You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
9 years ago
|
# DatePicker
|
||
10 years ago
|
|
||
10 years ago
|
- category: Components
|
||
10 years ago
|
- chinese: 日期选择框
|
||
9 years ago
|
- type: 表单
|
||
10 years ago
|
|
||
|
---
|
||
|
|
||
9 years ago
|
输入或选择日期的控件。
|
||
10 years ago
|
|
||
|
## 何时使用
|
||
|
|
||
9 years ago
|
当用户需要输入一个日期,可以点击标准输入框,弹出日期面板进行选择。
|
||
10 years ago
|
|
||
9 years ago
|
## API
|
||
|
|
||
10 years ago
|
```html
|
||
9 years ago
|
<DatePicker defaultValue="2015-01-01" />
|
||
10 years ago
|
```
|
||
|
|
||
10 years ago
|
| 参数 | 说明 | 类型 | 默认值 |
|
||
|
|--------------|----------------|----------|--------------|
|
||
|
| value | 日期 | string | 无 |
|
||
9 years ago
|
| defaultValue | 默认日期 | string | 无 |
|
||
10 years ago
|
| format | 展示的日期格式 | string | "yyyy-MM-dd" |
|
||
|
| disabledDate | 不可选择的日期 | function | 无 |
|
||
9 years ago
|
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(Date value) | 无 |
|
||
10 years ago
|
| disabled | 禁用 | bool | false |
|
||
9 years ago
|
| style | 自定义输入框样式 | object | {} |
|
||
|
| popupStyle | 格外的弹出日历样式 | object | {} |
|
||
9 years ago
|
| size | 输入框大小,`large` 高度为 32px,`small` 为 22px,默认是 28px | string | 无 |
|
||
9 years ago
|
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/issues/424) |
|
||
10 years ago
|
|
||
10 years ago
|
<style>
|
||
9 years ago
|
.code-box-demo .ant-calendar-picker {
|
||
9 years ago
|
margin: 0 8px 12px 0;
|
||
9 years ago
|
}
|
||
10 years ago
|
</style>
|