0👍
You can check if selectedDates.length === 2
in the onChange
event. So put to flatpickr @on-change="updateTrigger"
and then make function:
const updateTrigger = (selectedDates, dateStr, instance) => {
if (selectedDates.length === 2) {
$emit('update:filter', selectedDates);
}
};
- [Vuejs]-Inertiajs – Flashed data stays on the screen for one too many refreshes
- [Vuejs]-The lifecycle of functions in Vue3 templates
Source:stackexchange.com