From 713de12ef89460e55bbdf519a770c529f7eea9b3 Mon Sep 17 00:00:00 2001 From: Andreas Rein Date: Sun, 30 Aug 2020 00:19:34 +0200 Subject: [PATCH] Add change emit on month picker input --- example/App.vue | 1 + package.json | 2 +- src/MonthPicker.vue | 1 + src/MonthPickerInput.vue | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/example/App.vue b/example/App.vue index abf45b4..277c76b 100644 --- a/example/App.vue +++ b/example/App.vue @@ -148,6 +148,7 @@ :min-date="minDate !== null ? new Date(minDate) : null" :year-only="isYearOnly" :no-default="true" + @change="showDate" /> diff --git a/package.json b/package.json index 759c55b..ba82347 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-month-picker", - "version": "1.3.0", + "version": "1.3.1", "main": "src/index.js", "description": "A simple and elegant month picker for Vue", "scripts": { diff --git a/src/MonthPicker.vue b/src/MonthPicker.vue index 34c5f26..3361beb 100644 --- a/src/MonthPicker.vue +++ b/src/MonthPicker.vue @@ -139,6 +139,7 @@ export default { this.currentMonthIndex = index this.onChange() + if (input) { this.$emit('input', this.date) } diff --git a/src/MonthPickerInput.vue b/src/MonthPickerInput.vue index 46b9d4b..e8d7d2a 100644 --- a/src/MonthPickerInput.vue +++ b/src/MonthPickerInput.vue @@ -25,6 +25,7 @@ :min-date="minDate" :year-only="yearOnly" @input="populateInput" + @change="$emit('change', $event)" /> @@ -58,6 +59,7 @@ export default { }, mixins: [monthPicker], emits: [ + 'change', 'input' ], data() {