Vue2-datepicker: How to close the datepicker after selecting date range?

Created on 3 Sep 2019  路  4Comments  路  Source: mengxiong10/vue2-datepicker

I have tried change-calendar and panel-change events, it wasn't working. Please help me with it.

Most helpful comment

You can watch the value then close the popup when it is changed.

<date-picker v-model="value" ref="datepicker" range ></date-picker>
watch: {
   value (newDate, oldDate) {
        this.$refs.datepicker.closePopup()
   }
}

All 4 comments

you can using
this.$refs.datepicker.closePopup();
to close it.

tried it, not working with date range picker.

You can watch the value then close the popup when it is changed.

<date-picker v-model="value" ref="datepicker" range ></date-picker>
watch: {
   value (newDate, oldDate) {
        this.$refs.datepicker.closePopup()
   }
}

Thank you so much @mengxiong10 .

Was this page helpful?
0 / 5 - 0 ratings