Vue v-calendar date-picker single
by kabanoki
HTML
<div id='app'>
<v-date-picker
:input-props="{ class: 'input', name: 'event_dates', placeholder:'日付を入力' }"
:mode="mode"
:formats="formats"
v-model="selectedDate"></v-date-picker>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
<link rel='stylesheet' href='https://unpkg.com/v-calendar/lib/v-calendar.min.css'>
<script src='https://unpkg.com/v-calendar'></script>
CSS
body {
background: #20262E;
padding: 20px;
font-family: Helvetica;
}
#app {
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
li {
margin: 8px 0;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
del {
color: rgba(0, 0, 0, 0.3);
}
Vue
new Vue({
el: '#app',
data: {
mode: 'single',
formats: {
input: ['YYYY-MM-DD'],
},
selectedDate: null,
}
})