2016-03-31 14:17:09 +08:00
|
|
|
---
|
|
|
|
category: Components
|
2016-06-27 18:21:12 +08:00
|
|
|
type: Views
|
2016-03-31 14:17:09 +08:00
|
|
|
chinese: 日历
|
|
|
|
cols: 1
|
|
|
|
english: Calendar
|
|
|
|
---
|
2015-11-11 00:15:12 +08:00
|
|
|
|
2015-11-13 18:20:22 +08:00
|
|
|
按照日历形式展示数据的容器。
|
2015-11-11 00:15:12 +08:00
|
|
|
|
|
|
|
## 何时使用
|
|
|
|
|
2015-11-13 18:20:22 +08:00
|
|
|
当数据是日期或按照日期划分时,例如日程、课表、价格日历等,农历等。目前支持年/月切换。
|
|
|
|
|
2015-11-11 00:15:12 +08:00
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
```html
|
2015-11-13 19:56:34 +08:00
|
|
|
<Calendar
|
|
|
|
dateCellRender={dateCellRender}
|
|
|
|
monthCellRender={monthCellRender}
|
2015-11-15 21:40:01 +08:00
|
|
|
onPanelChange={onPanelChange}
|
2015-11-13 19:56:34 +08:00
|
|
|
/>
|
2015-11-11 00:15:12 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 |
|
|
|
|
|--------------|----------------|----------|--------------|
|
2015-11-13 19:56:34 +08:00
|
|
|
| value | 展示日期 | Date | 当前日期 |
|
2015-11-15 21:40:01 +08:00
|
|
|
| defaultValue | 默认展示日期 | Date | 当前日期 |
|
2015-11-13 20:32:54 +08:00
|
|
|
| mode | 初始模式,`month/year` | string | month |
|
2015-11-13 19:56:34 +08:00
|
|
|
| fullscreen | 是否全屏显示 | bool | true |
|
2015-11-15 21:40:01 +08:00
|
|
|
| dateCellRender | 自定义渲染日期单元格| function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/))| 无 |
|
|
|
|
| monthCellRender | 自定义渲染月单元格 | function([GregorianCalendar](https://github.com/yiminghe/gregorian-calendar/)) | 无 |
|
2015-11-13 19:56:34 +08:00
|
|
|
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/issues/424) |
|
2015-11-15 21:40:01 +08:00
|
|
|
| onPanelChange| 日期面板变化回调 | function(date, mode) | 无 |
|