ant-design-vue/components/calendar/index.en-US.md

42 lines
2.2 KiB
Markdown
Raw Normal View History

2018-03-13 14:40:13 +00:00
## API
**Note:** Part of the Calendar's locale is read from `value`. So, please set the locale of `moment` correctly.
2018-03-14 14:00:43 +00:00
````html
2018-03-13 14:40:13 +00:00
// The default locale is en-US, if you want to use other locale, just set locale in entry file globaly.
// import moment from 'moment';
// import 'moment/locale/zh-cn';
// moment.locale('zh-cn');
2018-03-14 14:00:43 +00:00
<a-calendar
@panelChange="onPanelChange"
@select="onSelect"
>
<template slot="dateCellRender" slot-scope="value"></template>
<template slot="monthCellRender" slot-scope="value"></template
</a-calendar>
````
customize the progress dot by setting a scoped slot
2018-03-13 14:40:13 +00:00
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
2018-03-14 14:00:43 +00:00
| dateCellRender | Customize the display of the date cell by setting a scoped slot, the returned content will be appended to the cell | function(date: moment) | - |
| dateFullCellRender | Customize the display of the date cell by setting a scoped slot, the returned content will override the cell | function(date: moment) | - |
2018-03-13 14:40:13 +00:00
| defaultValue | The date selected by default | [moment](http://momentjs.com/) | default date |
| disabledDate | Function that specifies the dates that cannot be selected | (currentDate: moment) => boolean | - |
| fullscreen | Whether to display in full-screen | boolean | `true` |
2018-03-14 14:00:43 +00:00
| locale | The calendar's locale | object | [default]
(https://github.com/vueComponent/ant-design/blob/master/components/date-picker/locale/example.json) |
2018-03-13 14:40:13 +00:00
| mode | The display mode of the calendar | `month` \| `year` | `month` |
2018-03-14 14:00:43 +00:00
| monthCellRender | Customize the display of the month cell by setting a scoped slot, the returned content will be appended to the cell | function(date: moment) | - |
| monthFullCellRender | Customize the display of the month cell by setting a scoped slot, the returned content will override the cell | function(date: moment) | - |
| value(v-model) | The current selected date | [moment](http://momentjs.com/) | current date |
### events
| Events Name | Description | Arguments |
| --- | --- | --- |
| panelChange | Callback for when panel changes | function(date: moment, mode: string) | - |
| select | Callback for when a date is selected | function(date: moment | - |
| change | Callback for when value change | function(date: moment | - |