2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-16 19:10:35 +03:00

feat: add calendar-change event (#432)

This commit is contained in:
mengxiong10
2020-03-06 16:11:04 +08:00
parent 2fb9e6710c
commit 17d2262c59
3 changed files with 28 additions and 24 deletions
+13 -12
View File
@@ -266,18 +266,19 @@ set fixed time list to select;
### Events
| Name | Description | Callback Arguments |
| ----------- | ------------------------------------ | -------------------------------------------- |
| input | When the value change(v-model event) | date |
| change | When the value change(same as input) | date, type(date, hour, minute, second, ampm) |
| open | When panel opening | |
| close | When panel closing | |
| confirm | When click 'confirm' button | date |
| clear | When click 'clear' button | |
| input-error | When user type a invalid Date | the input text |
| focus | When input focus | |
| blur | When input blur | |
| pick | when select date [#429](issues/429) | date |
| Name | Description | Callback Arguments |
| --------------- | ------------------------------------ | -------------------------------------------- |
| input | When the value change(v-model event) | date |
| change | When the value change(same as input) | date, type(date, hour, minute, second, ampm) |
| open | When panel opening | |
| close | When panel closing | |
| confirm | When click 'confirm' button | date |
| clear | When click 'clear' button | |
| input-error | When user type a invalid Date | the input text |
| focus | When input focus | |
| blur | When input blur | |
| pick | when select date [#429](issues/429) | date |
| calendar-change | when change the calendar | date, oldDate |
### Slots
+13 -12
View File
@@ -263,18 +263,19 @@ data() {
### 事件
| 名称 | 描述 | 回调函数的参数 |
| ----------- | ------------------------------- | -------------------------------------------- |
| input | 当选择日期的事件触发 | date |
| change | 当选择日期的事件触发 | date, type(date, hour, minute, second, ampm) |
| open | 当弹出层打开时候 | |
| close | 当弹出层关闭时候 | |
| confirm | 当点击确认按钮 | date |
| clear | 当点击清除按钮 | |
| input-error | 当输入一个无效的时间 | 输入的值 |
| focus | 当输入框有焦点 | |
| blur | 当输入框失焦 | |
| pick | 当点击日期时 [#429](issues/429) | date |
| 名称 | 描述 | 回调函数的参数 |
| --------------- | ------------------------------- | -------------------------------------------- |
| input | 当选择日期的事件触发 | date |
| change | 当选择日期的事件触发 | date, type(date, hour, minute, second, ampm) |
| open | 当弹出层打开时候 | |
| close | 当弹出层关闭时候 | |
| confirm | 当点击确认按钮 | date |
| clear | 当点击清除按钮 | |
| input-error | 当输入一个无效的时间 | 输入的值 |
| focus | 当输入框有焦点 | |
| blur | 当输入框失焦 | |
| pick | 当点击日期时 [#429](issues/429) | date |
| calendar-change | 当改变年月时 | date, oldDate |
### Slots
+2
View File
@@ -255,8 +255,10 @@ export default {
}
},
updateCalendar(date) {
const oldValue = new Date(this.innerCalendar);
this.innerCalendar = date;
this.$emit('update:calendar', date);
this.dispatch('DatePicker', 'calendar-change', date, oldValue);
},
handelPanelChange(panel) {
this.panel = panel;