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() {