Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Commit 3c5c0e2

Browse files
committed
feat: Add update-month-year event (resolves #107)
1 parent a5ebe30 commit 3c5c0e2

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ type EmitEvents =
1212
| 'blur'
1313
| 'internalModelChange'
1414
| 'recalculatePosition'
15-
| 'flow-step';
15+
| 'flow-step'
16+
| 'updateMonthYear';
1617

1718
interface Vue3DatePicker {
1819
uid?: string;

src/Vue3DatePicker/Vue3DatePicker.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
@auto-apply="autoApplyValue"
122122
@time-update="timeUpdate"
123123
@flow-step="$emit('flow-step', $event)"
124+
@update-month-year="$emit('updateMonthYear', $event)"
124125
>
125126
<template v-for="(slot, i) in slotList" #[slot]="args" :key="i">
126127
<slot :name="slot" v-bind="{ ...args }" />
@@ -184,6 +185,7 @@
184185
'internalModelChange',
185186
'recalculatePosition',
186187
'flow-step',
188+
'updateMonthYear',
187189
]);
188190
const props = defineProps({
189191
uid: { type: String as PropType<string>, default: null },

src/Vue3DatePicker/components/DatepickerMenu.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
'autoApply',
217217
'timeUpdate',
218218
'flow-step',
219+
'updateMonthYear',
219220
]);
220221
const props = defineProps({
221222
internalModelValue: { type: [Date, Array] as PropType<InternalModuleValue>, default: null },

src/Vue3DatePicker/components/composition/calendar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ export const useCalendar = (props: UseCalendar, emit: VueEmit, updateFlow: () =>
553553
}
554554
}
555555
updateFlow();
556+
emit('updateMonthYear', { instance, value, isMonth });
556557
};
557558

558559
const getSetDateTime = (dateValue: Date): Date => {

0 commit comments

Comments
 (0)