I am currently utilizing a library called vue-calendar, which includes an object known as calendarOptions. This object contains various methods to control how the calendar functions. One of these methods is the dateClick method, which returns the clicked date on the calendar in string format. I have attempted to save this value in arrivalDate without success. I have researched Vue.set() but believe the issue lies with what 'this' is referencing. In past scenarios, I have resolved similar issues by reassigning 'this' before the function, however, it is not possible in this case.
export default {
components: {
FullCalendar,
Banner
},
data() {
return {
calendarOptions: {
plugins: [dayGridPlugin, interactionPlugin],
initialView: 'dayGridMonth',
selectable: true,
dateClick: function(info) {
this.arrivalDate = info.dateStr
}
},
arrivalDate: ''
}
}
}
</script>