A Vue plugin for for attributed calendars date pickers using Vue 3, Typescript and Rollup.
yarn add v-calendar@next
v3.0.0-alpha.7
, all installation methods require manual import of component styles. This is due to Vite build restrictions in libary mode.
import 'v-calendar/dist/style.css';
import VCalendar from 'v-calendar';
// Use plugin with defaults
app.use(VCalendar, {})
<!-- Component.vue template -->
<template>
<v-calendar />
<v-date-picker v-model="date" />
</template>
// main.js
import { SetupCalendar, Calendar, DatePicker } from 'v-calendar';
// Setup plugin for defaults or `$screens` (optional)
app.use(SetupCalendar, {})
// Use the components
app.component('Calendar', Calendar)
app.component('DatePicker', DatePicker)
<!-- Component.vue template -->
<template>
<Calendar />
<DatePicker v-model="date" />
</template>
// main.js
import { SetupCalendar } from 'v-calendar';
// Setup plugin for defaults or `$screens` (optional)
app.use(SetupCalendar, {})
<!-- Component.vue template -->
<template>
<Calendar />
<DatePicker v-model="date">
</template>
// Component.vue script
import { Calendar, DatePicker } from 'v-calendar';
export default {
components: {
Calendar,
DatePicker,
},
data() {
return {
date: new Date(),
};
},
}
Please follow below mentioned steps to clone and build this project:
git clone https://github.com/nathanreyes/v-calendar
# Move to directory
cd v-calendar
yarn
git checkout next
# ES, CommonJS, IIFE and CSS
yarn build
yarn lint