<template>
<VueDatePicker v-model="date" ref="datepicker" />
</template>
<script setup>
import { ref } from 'vue';
const date = ref();
const datepicker = ref(null);
const yourCustomMethod = () => {
if (datepicker) {
// Close the menu programmatically
datepicker.value.closeMenu()
}
}
</script>
I am encountering an issue while trying to customize the VueDatePicker using the code above. The error message states that closeMenu() does not exist in type 'never'. Despite following the implementation as per the VueDatePicker documentation, I am unable to pinpoint the exact problem.
My goal is to resolve this problem efficiently.