I am new to VueJS and currently working on integrating the vue-hotel-datepicker
into my project. I am having trouble figuring out how to utilize the checkInChanged
event listener.
This is the code snippet from my template:
<datepicker
:startDate="startDate"
:checkInChanged="setCheckinDate()" //issue arises here
:maxNights="30"
:disabledDates="bookedDates"
:firstDayOfWeek="1"
:i18n="lang"
:showYear="true"
>
</datepicker>
The method in question:
methods: {
setCheckinDate() {
console.log('test');
}
}
The challenge is that this event triggers even before a check-in date is selected. How can I properly implement this functionality and retrieve the selected date instance within my setCheckinDate()
method?
UPDATE:
Refer to my gist for the complete code. Following suggestions, I have switched the listener from :checkInChanged
to @checkInChanged
, but unfortunately, the event is not being triggered as expected.