Vue v-calendar sample
by kabanoki
HTML
<link rel="stylesheet" href="https://unpkg.com/v-calendar/lib/v-calendar.min.css">
<script src="https://unpkg.com/v-calendar"></script>
<div id='app'>
<v-calendar :attributes="attrs" is-double-paned></v-calendar>
</div>
<script src="https://momentjs.com/downloads/moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
<script src="https://unpkg.com/[email protected]/lib/v-calendar.umd.min.js"></script>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
text-align: center;
}
Vue
var today = new Date();
new Vue({
el: '#app',
data: {
attrs: [
{
key: 'day1',
highlight: {
backgroundColor: '#ff8080',
// Other properties are available too, like `height` & `borderRadius`
},
dates: [
new Date(),
{
start: new Date(2019, 5, 1),
end: new Date(2019, 5, 5)
},
{
start: new Date(),
span: 5
}]
},
{
key: 'day2',
highlight: {
backgroundColor: '#80ff80',
// Other properties are available too, like `height` & `borderRadius`
},
dates: [
{
start: today.setDate(today.getDate() + 25),
span: 5
}]
}
],
}
})