Vuejs3-datepicker is a lightweight and configurable datepicker component designed exclusively for Vue 3 applications. Currently at version 1.1.3, the library receives updates approximately every few months, addressing bug fixes, adding new features like internationalization (e.g., Arabic-Tunisia), and internal build system improvements (e.g., Vite migration). Its core functionality includes standard date picking, support for `v-model` for two-way data binding, customizable date formatting, and options for disabling or highlighting specific dates. A key differentiator is its strict compatibility with Vue 3, making it a focused solution for modern Vue projects, unlike some older datepickers that might still support Vue 2.
npm install vuejs3-datepickerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Vue 3 setup using the `vuejs3-datepicker` component. It shows importing the component, using `v-model` for two-way binding, custom date formatting, enabling the clear button, setting Monday as the first day of the week, and handling `selected` and `closed` events. It also includes a programmatic way to clear the date.
Ensure your project is built with Vue 3. If you need Vue 2 compatibility, use a different datepicker library.
Prefer using `v-model="yourDateVariable"` for two-way data binding. If you need one-way binding, you can pass `:value="yourDateVariable"` and listen to the `@selected` event for updates.
Install and configure the desired icon library (e.g., `npm install @fortawesome/fontawesome-free` and import its CSS) in your Vue application.
No direct fix required for most users, but be aware of potential subtle behavioral changes if you extensively customize Vue directives that might interact with the datepicker's internal rendering.
Ensure you have `import Datepicker from 'vuejs3-datepicker';` in your script and that it's correctly registered in your component's `components` option or globally with `app.component('Datepicker', Datepicker)`.Always check if your date variable is not `null` or `undefined` before attempting to call `Date` object methods on it, e.g., `selectedDate.value ? selectedDate.value.toLocaleDateString() : 'No date'`.
Ensure that the `value` or `v-model` prop is always bound to a valid JavaScript `Date` object or `null` if no date is selected. If passing a string, ensure it's in a format the component can natively parse, or convert it to a `Date` object before passing.
Add `import 'vuejs3-datepicker/dist/vuejs3-datepicker.css';` to your main Vue entry file (e.g., `main.ts` or `main.js`) or within a component's style block if using a build system that supports it.
No dependency data recorded yet.