Methods
List of available methods that you can call on the datepicker from the external code
Add a ref
to the component, and call the method on that ref
Code Example
<template>
<Datepicker v-model="date" ref="datepicker" />
</template>
<script>
import { ref } from 'vue';
export default {
setup() {
const date = ref();
const datepicker = ref(null);
const yourCustomMethod = () => {
if (datepicker) {
// Close the menu programmatically
datepicker.value.closeMenu()
}
}
return {
date,
}
}
}
</script>
selectDate
When called and there is an active selection, it will select that date.
closeMenu
Closes the datepicker menu
openMenu
Opens the datepicker menu
clearValue
Clears the selected value