vue-datetime - open trigger
mariomka/vue-datetime open trigger
by 1004lucifer
HTML
<script src="https://unpkg.com/luxon"></script>
<script src="https://unpkg.com/vue-datetime"></script>
<script src="https://unpkg.com/weekstart"></script>
<div id="app">
<h2>vue-datetime</h2>
<datetime ref="datetimePicker"></datetime>
<button @click="openDatetime">openDatetimePicker</button>
</div>
CSS
@import url('https://unpkg.com/[email protected]/dist/vue-datetime.css');
body {
background: #20262E;
padding: 20px;
}
#app {
height: 500px;
background: #fff;
border-radius: 4px;
padding: 20px;
transition: all 0.2s;
}
h2 {
font-weight: bold;
margin-bottom: 15px;
}
Vue
new Vue({
el: "#app",
data: {
},
methods: {
openDatetime() {
this.$refs.datetimePicker.open(event)
}
}
})