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.
ant-design-vue/components/calendar/index.en-US.md

42 lines
2.2 KiB

7 years ago
## API
**Note:** Part of the Calendar's locale is read from `value`. So, please set the locale of `moment` correctly.
7 years ago
````html
7 years ago
// 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');
7 years ago
<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
7 years ago
| Property | Description | Type | Default |
| -------- | ----------- | ---- | ------- |
7 years ago
| 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) | - |
7 years ago
| 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` |
7 years ago
| locale | The calendar's locale | object | [default]
(https://github.com/vueComponent/ant-design/blob/master/components/date-picker/locale/example.json) |
7 years ago
| mode | The display mode of the calendar | `month` \| `year` | `month` |
7 years ago
| 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 | - |